Why it is showing no output | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Why it is showing no output

d=3 While d==15: Print(d) d=d+1

16th Jun 2019, 9:11 AM
Sumit Jaiswal
Sumit Jaiswal - avatar
3 Answers
+ 3
The while loop doesn't execute. It will only loop while the condition is true. As d=3 and the loop only executes when d=15, it will be skipped over.
16th Jun 2019, 9:14 AM
Russ
Russ - avatar
+ 3
It's because d is never equal 15, therefore the loop never executes. To print the numbers from 3 to 15, you should do it like this: d = 3 while d <= 15: print(d) d += 1
16th Jun 2019, 9:14 AM
Airree
Airree - avatar
+ 1
Thanks
16th Jun 2019, 9:16 AM
Sumit Jaiswal
Sumit Jaiswal - avatar