In this code if we cut out this code i=i+1 what will hapen???? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

In this code if we cut out this code i=i+1 what will hapen????

code i=1 while i <=10: if i%2==0: print(str(i) + " is even") else: print(str(i)+ " is odd") i=i+1

31st Aug 2020, 5:52 PM
𝓼𝓬𝓸𝓻𝓹
𝓼𝓬𝓸𝓻𝓹 - avatar
1 Answer
+ 5
It will loop infinitely and print 1 is odd as "i" value will never increment and it will always remain less than 10
31st Aug 2020, 5:54 PM
Abhay
Abhay - avatar