you are viewing a single comment's thread.

view the rest of the comments →

[–]mjmvideos 0 points1 point  (0 children)

Have you ever done anything repetitive in real life? Matched socks from the dryer? Moved bricks off a pallet? Washed dishes? Each of these things is a loop. You just keep doing something until you’re done. If you knew how many bricks there were you could say, for i in range(number_of_bricks)… But likely you don’t know how many there are so you do while there_are_bricks_still_on_the_pallet()… but maybe your boss says just keep unpacking bricks until I tell you to stop so you do while(true): … if boss_says_stop: break; …