0
What does "while True" mean?
3 Answers
+ 1
"while True:" (always remember to capitalize "True") functions just as it sounds. To understand it better think of "True" being "2 == 2" instead. For example... "while True: print('Hi')" will function the same as... "while 2 == 2: print('Hi')" "2 == 2" is a "True" statement. So "while" "2 is equal to 2" (which it always is) 'Hi' will be printed, which would be forever. Using "while True:" is mainly used to loop and repeat a code. Using "while False:" or "while 2 == 3:" will result in no output. Mess around with it :)
+ 1
while the computer doesn't know if something is true or if something can change is what I think it is.
0
while True: is an infinite loop . it means the code inside of it will always run (forever) unless you type break inside the block or you hold Ctrl+c in windows.