what mean «while» in python | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

what mean «while» in python

12th Feb 2019, 10:09 AM
Med Amine
Med Amine - avatar
2 Answers
+ 4
While loop is a type of loop in python. It does something until when the condition specified is true. while (True): print (1) # It will print 1 forever as the condition specified is always true.
12th Feb 2019, 11:21 AM
Arushi Singhania
Arushi Singhania - avatar
0
forget the code for a moment think of the logic in two states to begin with. while the sun is out its daylight until the sun goes down then its night two conditions one or the other. three states when the grand old duke was up, he was up when he was down, he was down when only halfway up neither up or down. thats three states up down the grey area null is neither
12th Feb 2019, 1:16 PM
peter
peter - avatar