File tree 3 files changed +18
-0
lines changed
3 files changed +18
-0
lines changed Original file line number Diff line number Diff line change 4
4
5
5
# Simulate the results of a series of coin tosses and track the results
6
6
7
+ # This one is tricky to structure correctly. Try writing out the logic before you start coding. Some additional pointers if you're stuck:
8
+ # 1. You will need to use a `for` loop over a range of trials.
9
+ # 2. For each trial, first you should check the outcome of the first flip.
10
+ # 3. Make sure you add the first flip to the total number of flips.
11
+ # 4. After the first toss, you'll need another loop to keep flipping while you get the same result as the first flip.
12
+
7
13
from random import randint
8
14
9
15
flips = 0
Original file line number Diff line number Diff line change 4
4
5
5
# Simulate the results of a series of coin tosses and track the results
6
6
7
+ # This one is tricky to structure correctly. Try writing out the logic before you start coding. Some additional pointers if you're stuck:
8
+ # 1. You will need to use a `for` loop over a range of trials.
9
+ # 2. For each trial, first you should check the outcome of the first flip.
10
+ # 3. Make sure you add the first flip to the total number of flips.
11
+ # 4. After the first toss, you'll need another loop to keep flipping while you get the same result as the first flip.
12
+
7
13
from random import randint
8
14
9
15
Original file line number Diff line number Diff line change 4
4
5
5
# Simulate the results of a series of coin tosses and track the results
6
6
7
+ # This one is tricky to structure correctly. Try writing out the logic before you start coding. Some additional pointers if you're stuck:
8
+ # 1. You will need to use a `for` loop over a range of trials.
9
+ # 2. For each trial, first you should check the outcome of the first flip.
10
+ # 3. Make sure you add the first flip to the total number of flips.
11
+ # 4. After the first toss, you'll need another loop to keep flipping while you get the same result as the first flip.
12
+
7
13
from random import randint
8
14
9
15
You can’t perform that action at this time.
0 commit comments