Skip to content

Commit 4fa269a

Browse files
committed
Make linter happy
1 parent f4d14af commit 4fa269a

File tree

4 files changed

+10
-9
lines changed

4 files changed

+10
-9
lines changed

python-break/for_loop_test_scores_example.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
# Use case 1: If the student fails 2 or more tests, the student must go to tutoring (for-loop)
1+
# Use case 1: If the student fails 2 or more tests,
2+
# the student must go to tutoring (for-loop)
23
scores = [90, 30, 50, 70, 85, 35]
34

45
num_failed_scores = 0

python-break/nested_loop_number_of_failed_students_example.py

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,5 @@
11
# Use case 4: Check to see how many students have failed a test (nested loop)
2-
scores = [
3-
[90, 30, 80, 100],
4-
[100, 80, 95, 87],
5-
[75, 84, 77, 90]
6-
]
2+
scores = [[90, 30, 80, 100], [100, 80, 95, 87], [75, 84, 77, 90]]
73

84
failed_score = 60
95
num_failed_students = 0

python-break/user_input_example.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,16 @@
88

99
while True:
1010
if guesses_left <= 0:
11-
print("You ran out of guesses! The correct number was " + str(random_number))
11+
print(
12+
"You ran out of guesses! The correct number was "
13+
+ str(random_number)
14+
)
1215
break
1316
guess = input("Guess a number between 1 and 10, or enter q to quit:")
1417
if guess == "q":
1518
print("Successfully exited game.")
1619
break
17-
elif(not(guess.isnumeric())):
20+
elif not (guess.isnumeric()):
1821
guess = input("Please enter a valid value: ")
1922
else:
2023
if int(guess) == random_number:

python-break/while_loop_print_test_scores_example.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44

55
while i < 5:
66
if i > len(scores) - 1:
7-
# If there are less than 5 scores, break out of the loop when all scores are printed
7+
# If there are less than 5 scores,
8+
# break out of the loop when all scores are printed
89
break
910
print("Score: " + str(scores[i]))
1011
i += 1

0 commit comments

Comments
 (0)