Can I get advice on this? I'm getting really frustrated 😞 | Sololearn: Learn to code for FREE!
¡Nuevo curso! ¡Todo programador debería aprender IA Generativa!
Prueba una lección gratuita
+ 1

Can I get advice on this? I'm getting really frustrated 😞

https://code.sololearn.com/cbTp3xHwOpw9/?ref=app

27th Oct 2019, 3:43 AM
Ryesha Aimes-Thompson
Ryesha Aimes-Thompson - avatar
3 Respuestas
+ 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)
27th Oct 2019, 5:42 AM
Diego
Diego - avatar
0
The point is to enter grades and get the second smallest to print
27th Oct 2019, 4:22 AM
Ryesha Aimes-Thompson
Ryesha Aimes-Thompson - avatar
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.
27th Oct 2019, 4:55 AM
Ryesha Aimes-Thompson
Ryesha Aimes-Thompson - avatar