Skip to content

Commit 30b6d8c

Browse files
authored
Updated for-loop code example
Changed variable names to use underscores, rather than camel-case
1 parent 69d2c6c commit 30b6d8c

1 file changed

Lines changed: 9 additions & 9 deletions

File tree

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
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, the student must go to tutoring (for-loop)
22
scores = [90, 30, 50, 70, 85, 35]
33

4-
numFailedScores = 0
5-
failedScore = 60
6-
needsTutoring = False
4+
num_failed_scores = 0
5+
failed_score = 60
6+
needs_utoring = False
77
for score in scores:
8-
if score < failedScore:
9-
numFailedScores += 1
10-
if numFailedScores >= 2:
11-
needsTutoring = True
8+
if score < failed_score:
9+
num_failed_scores += 1
10+
if num_failed_scores >= 2:
11+
needs_tutoring = True
1212
break
1313

14-
print("Does the student need tutoring? " + str(needsTutoring))
14+
print("Does the student need tutoring? " + str(needs_tutoring))

0 commit comments

Comments
 (0)