Chinese, asked by drrupsdent, 5 months ago

4. Following code contain an endless loop. Could you find out why? Suggest a solution.
n=10
answers
while(n>0):
Answers answer+n**
nenti
print(answer)​

Answers

Answered by rohitkhajuria90
7

Because value of n is always 10 and while loop always satisfies the condition Hence infinite loop.

in while loop write statement

n = n - 1

Also, please write the question properly. We have to made assumptions.

Similar questions