I can't get why there is spamming in output ? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 4

I can't get why there is spamming in output ?

https://code.sololearn.com/cNF0CQcX77p7/?ref=app

10th Aug 2020, 2:00 PM
S.G.INGALE
S.G.INGALE - avatar
4 Answers
+ 3
10th Aug 2020, 3:47 PM
S.G.INGALE
S.G.INGALE - avatar
+ 2
3 will always smaller than 5
10th Aug 2020, 2:05 PM
durian
durian - avatar
+ 2
The first while loop will always be false hence the print("ok") is skipped In second loop it will print &&& until 3<=5 which will always remain true and hence it will run infinitely (till timed out)
10th Aug 2020, 3:32 PM
Amit Kumar
Amit Kumar - avatar
0
You have no termination condition for while loop. So it infinite loops.. First condition in loop is false so don't get execute. Second loop condition is always true. So infinite loop.
10th Aug 2020, 2:46 PM
Jayakrishna 🇮🇳