Skip to content

Fix typos in comments #83

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Aug 2, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion ch08-conditional-logic/6-recover-from-errors.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@


# Exercise 2
# Print character and specifid index in string
# Print character and specified index in string

input_string = input("Enter a string: ")

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@


# Exercise 1
# Write a function that simulatee the roll of a die.
# Write a function that simulates the roll of a die.
def roll():
"""Return random integer between 1 and 6"""
return randint(1, 6)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def coin_flip():
first_flip = coin_flip()
flips = flips + 1
# Continue flipping the coin and updating the tally until
# a different result is returned by coin_flips()
# a different result is returned by coin_flip()
while coin_flip() == first_flip:
flips = flips + 1
# Increment the flip tally once more to account for the
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@


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

# Flip the coin the first time
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
else:
votes_for_B = votes_for_B + 1

# Determine who wins the erd region
# Determine who wins the 3rd region
if random() < 0.17:
votes_for_A = votes_for_A + 1
else:
Expand Down