皇冠足球体育

If you're seeing this message, it means we're having trouble loading external resources on our website.

If you're behind a web filter, please make sure that the domains *.kastatic.org and *.kasandbox.org are unblocked.

Main content

Unit 3: Simulating phenomena with loops

View my programsTop programs

About this unit

How can you use computers to predict outcomes that are too big for humans to calculate? Discover repetition with while loops and for loops with range. Learn how to simulate events over time by setting up experiments with randomness and repeating them with loops.

Why reinvent the wheel when you can import wheel?
Control flow isn't always linear. Sometimes, it loops!
For when you know the number of times you want to repeat.