+ 3

чтŠ¾-тŠ¾ ŠæŠ¾ŃˆŠ»Š¾ Š½Šµ тŠ°Šŗ? something went wrong?

i=2 while i<=2: print(i) i-=1

22nd Jan 2021, 4:09 AM
Gafurov RuslanšŸ‡·šŸ‡ŗšŸ¤©
Gafurov RuslanšŸ‡·šŸ‡ŗšŸ¤© - avatar
1 Answer
+ 7
What were you expecting? You've set i to 2. Then you're running a while loop till i is smaller than or equal to 2, and subtracting 1 from `i` each time. So the value of `i` will keep decreasing and will always be <= 2. So it is an infinite loop that prints infinitey from 2 subtracting 1 each time
22nd Jan 2021, 4:28 AM
XXX
XXX - avatar