8000 Black formatting pass · rakash/python-basics-exercises@444f461 · GitHub
[go: up one dir, main page]

Skip to content

Commit 444f461

Browse files
committed
Black formatting pass
1 parent 026a399 commit 444f461

File tree

4 files changed

+13
-6
lines changed

4 files changed

+13
-6
lines changed

ch06-functions-and-loops/5-challenge.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44

55
# Calculate compound interest to track the growth of an investment
66

7+
78
def invest(amount, rate, years):
89
for year in range(1, years + 1):
910
amount = amount * (1 + rate)

ch08-conditional-logic/9a-challenge.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,13 @@
44

55
# Simulate the results of a series of coin tosses and track the results
66

7-
# This one is tricky to structure correctly. Try writing out the logic before you start coding. Some additional pointers if you're stuck:
7+
# This one is tricky to structure correctly. Try writing out the logic before
8+
# you start coding. Some additional pointers if you're stuck:
89
# 1. You will need to use a `for` loop over a range of trials.
910
# 2. For each trial, first you should check the outcome of the first flip.
1011
# 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+
# 4. After the first toss, you'll need another loop to keep flipping while you
13+
# get the same result as the first flip.
1214

1315
from random import randint
1416

ch08-conditional-logic/9b-challenge.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,13 @@
44

55
# Simulate the results of a series of coin tosses and track the results
66

7-
# This one is tricky to structure correctly. Try writing out the logic before you start coding. Some additional pointers if you're stuck:
7+
# This one is tricky to structure correctly. Try writing out the logic before
8+
# you start coding. Some additional pointers if you're stuck:
89
# 1. You will need to use a `for` loop over a range of trials.
910
# 2. For each trial, first you should check the outcome of the first flip.
1011
# 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+
# 4. After the first toss, you'll need another loop to keep flipping while you
13+
# get the same result as the first flip.
1214

1315
from random import randint
1416

ch08-conditional-logic/9c-challenge.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,13 @@
44

55
# Simulate the results of a series of coin tosses and track the results
66

7-
# This one is tricky to structure correctly. Try writing out the logic before you start coding. Some additional pointers if you're stuck:
7+
# This one is tricky to structure correctly. Try writing out the logic before
8+
# you start coding. Some additional pointers if you're stuck:
89
# 1. You will need to use a `for` loop over a range of trials.
910
# 2. For each trial, first you should check the outcome of the first flip.
1011
# 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+
# 4. After the first toss, you'll need another loop to keep flipping while you
13+
# get the same result as the first flip.
1214

1315
from random import randint
1416

0 commit comments

Comments
 (0)
0