total = 0 while True: # prompt the user to enter a number num = input("Enter a number (or type 'no more' to stop): ") | Sololearn: Learn to code for FREE!
Neuer Kurs! Jeder Programmierer sollte generative KI lernen!
Kostenlose Lektion ausprobieren
- 1

total = 0 while True: # prompt the user to enter a number num = input("Enter a number (or type 'no more' to stop): ")

can anyone tell me the logic of this code

26th Dec 2022, 1:15 PM
Udit pratap singh
Udit pratap singh - avatar
1 Antwort
+ 5
If you write it in a single line, it is a syntax error and won't work.
26th Dec 2022, 1:29 PM
Tibor Santa
Tibor Santa - avatar