loading...

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

FULL DISCUSSION
 

Someone in our team brought this:

times_eaten = 0
while(times_eaten < 3):
    print('I am eating')
    times_eaten += 1

As he would eat three times till he feels not hungry.

 

This one is probably the best. :)

code of conduct - report abuse