+ 1
It is showing time limit exceeded why
a=2 while a>1: print ('mad')
4 Antworten
+ 4
Look at the explanation you got here five minutes ago:
https://www.sololearn.com/Discuss/1846537/?ref=app
+ 3
Sumit Jaiswal
You don't change the value of a in the loop. So the loops checks always 2 > 1 -> always true. A while loops runs until the condition gets false.
+ 1
It's an infinite loop, "a" will always be bigger than 1 as you gave it the value 2
+ 1
A is greater than 1 it's true then why