while loops | Intro to CS - Python | Khan Academy

  Рет қаралды 2,358

Khan Academy

Khan Academy

Күн бұрын

Пікірлер: 2
@KelsieJG__they-them
@KelsieJG__they-them 2 ай бұрын
A small change I would make is have your coin flip count start at 1, because it's only at 0 before you run the while loop. You can see it prints out that you've done 0 coin flips after your first coin flip, and ends at 4 flips when it's really been 5.
@khanacademy
@khanacademy 2 ай бұрын
It all depends on where you print the number of coin flips in the loop! If we moved the print statement until after the line `num_flips = num_flips + 1`, then we would see that the number of flips is 1 at the end of the first loop iteration.
Tracing loop execution | Intro to CS - Python | Khan Academy
4:56
Khan Academy
Рет қаралды 4,3 М.
InvertBinaryTree Code : Java
3:53
Basics Strong
Рет қаралды
pumpkins #shorts
00:39
Mr DegrEE
Рет қаралды 12 МЛН
Do you choose Inside Out 2 or The Amazing World of Gumball? 🤔
00:19
Bike Vs Tricycle Fast Challenge
00:43
Russo
Рет қаралды 100 МЛН
for loops with range() | Intro to CS - Python | Khan Academy
4:23
Python 3.13's new REPL is AMAZING
10:21
Carberra
Рет қаралды 55 М.
Intro to radioactive decay | Physics | Khan Academy
8:02
Khan Academy
Рет қаралды 27 М.
While loops in Python are easy ♾️
6:58
Bro Code
Рет қаралды 367 М.
Please Master These 10 Python Functions…
22:17
Tech With Tim
Рет қаралды 164 М.
5 Useful F-String Tricks In Python
10:02
Indently
Рет қаралды 309 М.
pumpkins #shorts
00:39
Mr DegrEE
Рет қаралды 12 МЛН