M2Box Logo

Loops & randomness in Python | Khan Academy

Programming
Tahun2023
Durasi36m

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.Courses on Khan Academy are always 100% free. Start practicing—and saving your progress—now with our Intro to Computer Science - Python course!Course link: https://www.khanacademy.org/computing/intro-to-python-fundamentals/x5279a44ae0ab15d6:simulating-phenomena-with-loopsFull course playlist: https://www.youtube.com/playlist?list=PLSQl0a2vh4HDkbhG0sDW0b-VZXykEIAe5Khan Academy is a nonprofit organization with the mission of providing a free, world-class education for anyone, anywhere. We offer quizzes, questions, instructional videos, and articles on a range of academic subjects, including math, biology, chemistry, physics, history, economics, finance, grammar, preschool learning, and more. We provide teachers with tools and data so they can help their students develop the skills, habits, and mindsets for success in school and beyond. Khan Academy has been translated into dozens of languages, and 15 million people around the globe learn on Khan Academy every month. As a 501(c)(3) nonprofit organization, we would love your help! Donate or volunteer today! Donate here: https://www.khanacademy.org/donate?utm_source=youtube&utm_medium=desc Volunteer here: https://www.khanacademy.org/contribute?utm_source=youtube&utm_medium=desc

Mungkin Anda Juga Suka

Komentar

8 Komentar

cote di'voireJun 24, 2025

Learn how to terminate a loop early with the break statement and how to skip to the next iteration with the continue statement. View the program used in this video at: https://www.khanacademy.org/python-pr... Courses on Khan Academy are always 100% free. Start practicing—and saving your progress—now with our Intro to Computer Science - Python course! Course link: https://www.khanacademy.org/computing... Course playlist: •IntrotoComputerScience-Python|Khan... Khan Academy is a nonprofit organization with the mission of providing a free, world-class education for anyone, anywhere. We offer quizzes, questions, instructional videos, and articles on a range of academic subjects, including math, biology, chemistry, physics, history, economics, finance, grammar, preschool learning, and more. We provide teachers with tools and data so they can help their students develop the skills, habits, and mindsets for success in school and beyond. Khan Academy has been translated into dozens of

Betsnat BtJun 24, 2025

Learn how to use for loops with range() to repeat a block of code a fixed number times. Trace how the computer updates the loop variable during execution. View the program used in this video at: https://www.khanacademy.org/python-pr... Courses on Khan Academy are always 100% free. Start practicing—and saving your progress—now with our Intro to Computer Science - Python course! Course link: https://www.khanacademy.org/computing... Course playlist: •IntrotoComputerScience-Python|Khan... Khan Academy is a nonprofit organization with the mission of providing a free, world-class education for anyone, anywhere. We offer quizzes, questions, instructional videos, and articles on a range of academic subjects, including math, biology, chemistry, physics, history, economics, finance, grammar, preschool learning, and more. We provide teachers with tools and data so they can help their students develop the skills, habits, and mindsets for success in school and beyond. Khan Academy has bee

@bhavu9892Jun 24, 2025

Code along with a software engineer in this worked example using for loops and randomness. Apply for loops with range() to build a honeybee simulation. Model nectar collection with a state machine to answer the question: how much honey does a beehive produce in a week? View the program used in this video at: https://www.khanacademy.org/python-pr... Courses on Khan Academy are always 100% free. Start practicing—and saving your progress—now with our Intro to Computer Science - Python course! Course link: https://www.khanacademy.org/computing... Course playlist: •IntrotoComputerScience-Python|Khan... Khan Academy is a nonprofit organization with the mission of providing a free, world-class education for anyone, anywhere. We offer quizzes, questions, instructional videos, and articles on a range of academic subjects, including math, biology, chemistry, physics, history, economics, finance, grammar, preschool learning, and more. We provide teachers with tools and data so they can

Mr.whiteJun 24, 2025

Trace how the computer executes a while loop step-by-step. Practice how to use the loop variable stop, start, and update values to count the number of loop repetitions. View the program used in this video at: https://www.khanacademy.org/python-pr... Courses on Khan Academy are always 100% free. Start practicing—and saving your progress—now with our Intro to Computer Science - Python course! Course link: https://www.khanacademy.org/computing... Course playlist: •IntrotoComputerScience-Python|Khan... Khan Academy is a nonprofit organization with the mission of providing a free, world-class education for anyone, anywhere. We offer quizzes, questions, instructional videos, and articles on a range of academic subjects, including math, biology, chemistry, physics, history, economics, finance, grammar, preschool learning, and more. We provide teachers with tools and data so they can help their students develop the skills, habits, and mindsets for success in school and beyond. Khan A

Abi Nas❤️❤️Jun 24, 2025

Learn how to use while loops to repeat execution of a block of code. Trace how a loop variable updates inside of the loop body to eventually terminate the loop. View the program used in this video at: https://www.khanacademy.org/python-pr... Courses on Khan Academy are always 100% free. Start practicing—and saving your progress—now with our Intro to Computer Science - Python course! Course link: https://www.khanacademy.org/computing... Course playlist: •IntrotoComputerScience-Python|Khan... Khan Academy is a nonprofit organization with the mission of providing a free, world-class education for anyone, anywhere. We offer quizzes, questions, instructional videos, and articles on a range of academic subjects, including math, biology, chemistry, physics, history, economics, finance, grammar, preschool learning, and more. We provide teachers with tools and data so they can help their students develop the skills, habits, and mindsets for success in school and beyond. Khan Academy h

Nteboheleng MonyakeJun 24, 2025

Code along with a software engineer in this worked example using modules imports and randomness. Import and use functionality from other modules to build a basic robot simulation. Apply the random module to randomly decide the robot's movement. View the program used in this video at: https://www.khanacademy.org/python-pr... Courses on Khan Academy are always 100% free. Start practicing—and saving your progress—now with our Intro to Computer Science - Python course! Course link: https://www.khanacademy.org/computing... Course playlist: •IntrotoComputerScience-Python|Khan... Khan Academy is a nonprofit organization with the mission of providing a free, world-class education for anyone, anywhere. We offer quizzes, questions, instructional videos, and articles on a range of academic subjects, including math, biology, chemistry, physics, history, economics, finance, grammar, preschool learning, and more. We provide teachers with tools and data so they can help their students devel

RAMONA MOUZ🇬🇦🇨🇬🇨🇩Jun 24, 2025

How can we reuse functionality other programmers have already built? Learn how to import Python modules into your programs to access libraries of existing code. Examine the security and copyright implications of using someone else's work. Courses on Khan Academy are always 100% free. Start practicing—and saving your progress—now with our Intro to Computer Science - Python course! Course link: https://www.khanacademy.org/computing... Course playlist: •IntrotoComputerScience-Python|Khan... Khan Academy is a nonprofit organization with the mission of providing a free, world-class education for anyone, anywhere. We offer quizzes, questions, instructional videos, and articles on a range of academic subjects, including math, biology, chemistry, physics, history, economics, finance, grammar, preschool learning, and more. We provide teachers with tools and data so they can help their students develop the skills, habits, and mindsets for success in school and beyond. Khan Academy has b

Mphatso Princess MacJun 24, 2025

How can we use computers to predict outcomes that are too big for humans to calculate? Discover how programmers use simulations to model real world phenomena by repeating experiments over a series of time steps. Courses on Khan Academy are always 100% free. Start practicing—and saving your progress—now with our Intro to Computer Science - Python course! Course link: https://www.khanacademy.org/computing... Course playlist: •IntrotoComputerScience-Python|Khan... Khan Academy is a nonprofit organization with the mission of providing a free, world-class education for anyone, anywhere. We offer quizzes, questions, instructional videos, and articles on a range of academic subjects, including math, biology, chemistry, physics, history, economics, finance, grammar, preschool learning, and more. We provide teachers with tools and data so they can help their students develop the skills, habits, and mindsets for success in school and beyond. Khan Academy has been translated into dozens