Skip to content

Commit a7f6e16

Browse files
committed
Post final-qa fixes
1 parent d59c928 commit a7f6e16

File tree

11 files changed

+15
-14
lines changed

11 files changed

+15
-14
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
for hour in range(0, 3):
1+
for hour in range(0, 24):
22
for minute in range(0, 60):
33
print(f"{hour:02d}:{minute:02d}")

python-nested-loops/duplicate_check1.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@
22
for i, first_id in enumerate(crew_ids):
33
for second_id in crew_ids[i + 1 :]:
44
if first_id == second_id:
5-
print(f"Clone detected: id {first_id} is a duplicate.")
5+
print(f"Clone found: id={first_id} is a duplicate.")
Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
crew_ids = [1, 2, 8, 4, 5, 6, 7, 8, 9, 10]
22
detected = set()
3-
for id in crew_ids:
4-
if id in detected:
5-
print(f"Clone found: id {id} is a duplicate.")
3+
for crew_id in crew_ids:
4+
if crew_id in detected:
5+
print(f"Clone found: id={crew_id} is a duplicate.")
66
else:
7-
detected.add(id)
7+
detected.add(crew_id)

python-nested-loops/duplicate_check3.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@
44
detected = Counter(crew_ids)
55
for key, value in detected.items():
66
if value > 1:
7-
print(f"Clone found: id {key} is a duplicate.")
7+
print(f"Clone found: id={key} is a duplicate.")

python-nested-loops/multilist_sum.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,5 @@
33
for planet in resource_donators:
44
for resource in planet:
55
total_resources += resource
6-
print(f"Total resources gotten for interstellar travels: {total_resources}")
6+
7+
print(f"All resources gathered for interstellar travels: {total_resources}")

python-nested-loops/pancake1.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
pancake_stacks = []
21
bases = ["plain", "chocolate", "blueberry"]
32
toppings = ["honey", "whipped cream", "alien syrup"]
4-
3+
pancake_stacks = []
54
for base in bases:
65
for topping in toppings:
76
pancake_stacks.append(f"{base.capitalize()} pancake with {topping}")
7+
88
print(pancake_stacks)

python-nested-loops/pancake2.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
bases = ["plain", "chocolate", "blueberry"]
22
toppings = ["honey", "whipped cream", "alien syrup"]
3-
43
pancake_stacks = [
54
f"{base.capitalize()} pancake with {topping}"
65
for base in bases

python-nested-loops/readability_challenge.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,6 @@
66
for section in range(sections):
77
for living_quarter in range(living_quarters):
88
print(
9-
f"Scanning quarter {living_quarter} in section {section} "
10-
f"on floor {floor} for the intruder..."
9+
f"Scanning quarter {living_quarter} in section {section}"
10+
f" on floor {floor} for the intruder..."
1111
)

python-nested-loops/sandwich1.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
print(f"Found the crispy {target}!")
1212
found = True
1313
break
14+
1415
if found:
1516
print("Enjoying the crunch and worth it.")
1617
break

python-nested-loops/sandwich2.py

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

1717
if found:
18+
print("Enjoying the crunch and worth it.")
1819
break
19-
print("Enjoying the crunch and worth it.")

0 commit comments

Comments
 (0)