0
help??
studentsLastName = input('Enter students last name\n') TotalMarks = int(input( 'Enter students total marks\n')) / 5 if TotalMarks >=59: Lettergrade=('F') elif TotalMarks >=60 and TotalMarks<70: Lettergrade=('D') elif TotalMarks >=70 and TotalMarks<80: Lettergrade=('C') elif TotalMarks >=80 and TotalMarks<90: Lettergrade=('B') elif TotalMarks >=90 and TotalMarks<100: Lettergrade=('A') else: LetterGrade=('F') print('Student ',studentsLastName,'has a score of ',TotalMarks,'which gives a grade of:') #####when I run it I don't get the results that I need.
1 ответ
+ 1
Assume the TotalMarks is 74.
Because 74 >= 59, Lettergrade become 'F' and the other elif statements won't execute. You have to either reorder your if and elif statements or change condition to TotalMarks < ...