E5F0 Merge pull request #83 from realpython/fix_typos_ch08 · miet37/python-basics-exercises@6aa39b8 · GitHub
[go: up one dir, main page]

Skip to content

Commit 6aa39b8

Browse files
Merge pull request realpython#83 from realpython/fix_typos_ch08
Fix typos in comments
2 parents a0f5a35 + d65ea99 commit 6aa39b8

5 files changed

+6
-6
lines changed

ch08-conditional-logic/6-recover-from-errors.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515

1616

1717
# Exercise 2
18-
# Print character and specifid index in string
18+
# Print character and specified index in string
1919

2020
input_string = input("Enter a string: ")
2121

ch08-conditional-logic/7-simulate-events-and-calculate-probabilities.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77

88
# Exercise 1
9-
# Write a function that simulatee the roll of a die.
9+
# Write a function that simulates the roll of a die.
1010
def roll():
1111
"""Return random integer between 1 and 6"""
1212
return randint(1, 6)

ch08-conditional-logic/8b-challenge-simulate-a-coin-toss-experiment.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def coin_flip():
3131
first_flip = coin_flip()
3232
flips = flips + 1
3333
# Continue flipping the coin and updating the tally until
34-
# a different result is returned by coin_flips()
34+
# a different result is returned by coin_flip()
3535
while coin_flip() == first_flip:
3636
flips = flips + 1
3737
# Increment the flip tally once more to account for the

ch08-conditional-logic/8c-challenge-simulate-a-coin-toss-experiment.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,9 @@
1616

1717

1818
def single_trial():
19-
"""Simulate repeatedly a coing until both heads and tails are seen."""
19+
"""Simulate repeatedly flipping a coin until both heads and tails are seen."""
2020
# This function uses random.randint() to simulate a single coin toss.
21-
# randing(0, 1) randomly returns 0 or 1 with equal probability. We can
21+
# randint(0, 1) randomly returns 0 or 1 with equal probability. We can
2222
# use 0 to represent heads and 1 to represent tails.
2323

2424
# Flip the coin the first time

ch08-conditional-logic/9a-challenge-simulate-an-election.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@
2626
else:
2727
votes_for_B = votes_for_B + 1
2828

29-
# Determine who wins the erd region
29+
# Determine who wins the 3rd region
3030
if random() < 0.17:
3131
votes_for_A = votes_for_A + 1
3232
else:

0 commit comments

Comments
 (0)
0