- 5
Write a program to accept the grades for 5 students, and print a summary report as follows : Grade A :…… Grade B : …… Grade
5 Antworten
+ 6
Jaina Solanki
Why not first show your attempt and then ask for the answer🤔
+ 5
It looks like you wrote this external to Sololearn.
Do you get the error when tring to run your code on Sololearn.
All inputs must be entered at the same time before hitting run, else you get an error. (eof - I think)
This makes it hard to test while loops within sololearn that prompt for user inputs on each cycle.
Your code will run if you enter
Bob
A
Jak
B
Ken
C
BEFORE YOU HIT RUN
+ 2
1) #FOR 3 STUDENTS
i=1
while i<=3:
SN=input("ENTER THE STUDENT NAME")
G=input("ENTER THE GRADE")
if G=='A':
A='A'
a = SN
elif G=='B':
B='B'
b = SN
elif G=='C':
C='C'
c = SN
i=i+1
print("Grade",A,":",a)
print("Grade",B,":",b)
print("Grade",C,":",c)
Getting error in print part, any idea what's wrong ?
0
Any idea what's wrong ? Ashwin Maurya