I feel like my code is correct, but keep getting wrong output for this homework question.
The problem is:
Below are a set of scores that students have received in the past semester. Write code to determine how many are 90 or above and assign that result to the value a_scores.
The problem is:
Below are a set of scores that students have received in the past semester. Write code to determine how many are 90 or above and assign that result to the value a_scores.
scores = "67 80 90 78 93 20 79 89 96 97 92 88 79 68 58 90 98 100 79 74 83 88 80 86 85 70 90 100" #my attempt below accum = 0 for sc in scores: if sc >= 90: accum = accum + 1 a_scores = accum print(a_scores)
Output:85
#should be 10
#looking at it again, it appears to be just counting the number of characters (incl. spaces) that are in the string scores, (i.e., 85 characters)