loading...

re: What is the simplest code to explain a loop? VIEW POST

FULL DISCUSSION
 

Another guy came up with this:

speedometer = 0
while (speedometer <= 220):
    print("car speed is", speedometer)
    speedometer += 1

And then we can go into and operator with:

speedometer = 0
hold_in_gas = True
while (speedometer <= 220 and hold_in_gas):
    print("car speed is", speedometer)
    speedometer += 1
code of conduct - report abuse