172k views
2 votes
Retype and run, note incorrect behavior. Then fix errors in the code, which should print num_stars asterisks.

while num_printed != num_stars:
print('*')
Sample output with input: 3
*
*
*

1 Answer

3 votes

Answer:

Written in Python:

num_printed = 0

num_stars = int(input())

while(num_printed < num_stars):

print('*')

num_printed += 1

Step-by-step explanation:

User Jhmt
by
5.4k points