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
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
Computer Science,
2 months ago
Chemistry,
2 months ago
Science,
5 months ago
Chemistry,
10 months ago
Chemistry,
10 months ago