inelegant sample code
In box [13] you define a Rating variable that you don't need. A simpler solution is
PlayListRatings = [10, 9.5, 10, 8, 7.5, 5, 10, 10]
i = 0
while PlayListRatings[i] >= 6:
print(PlayListRatings[i])
i = i + 1
if(i > 1000):
break
Note this example includes a safety mechanism that avoids infinite looping. I would never teach the while loop without warning students about the dangers of infinite looping. . . .
1
vote
Todd Morley
shared this idea