+ 1
Can I get advice on this? I'm getting really frustrated 😞
3 Antworten
+ 1
If we suppose there are at least two different grades and the maximum grade possible is 100 you can try this
n = int(input("How many students are in your class? "))
min_score = 101
i = 0
while i < n:
print("Enter student's score: ",i)
x = int(input())
if x < min_score:
min_score2 = min_score
min_score = x
i += 1
print("The second lowest score is: ", min_score2)
0
The point is to enter grades and get the second smallest to print
0
I would love to do it that way but my teacher wants me to do it without using lists and indexing, etc. The only things I can use are if/else statements and, for and while loops.