Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- print ('Please enter your four test grades in the prompts below.')
- testAverage = 0
- while testAverage != -1:
- test1 = int(input('Please enter your first test grade: '))
- test2 = int(input('Please enter your second test grade: '))
- test3 = int(input('Please enter your third test grade: '))
- test4 = int(input('Please enter your fourth test grade: '))
- testAverage = (test1+test2+test3+test4)/4
- if testAverage >=90:
- print ('You have an A in the class, your test average is: ', testAverage)
- if 80 <= testAverage < 90:
- print ('You have a B in the class, your test average is: ', testAverage)
- if 70 <= testAverage < 80:
- print ('You have a C in the class, your test average is: ', testAverage)
- if 60 <= testAverage < 70:
- print ('You have a D in the class, your test average is: ', testAverage)
- if testAverage >= 70:
- print ('You have passed this course.')
- else:
- print ('You have received an F and have failed this course.')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement