Advertisement
Guest User

Untitled

a guest
Feb 24th, 2019
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.99 KB | None | 0 0
  1. print ('Please enter your four test grades in the prompts below.')
  2. testAverage = 0
  3.  
  4. while testAverage != -1:
  5.     test1 = int(input('Please enter your first test grade: '))
  6.     test2 = int(input('Please enter your second test grade: '))
  7.     test3 = int(input('Please enter your third test grade: '))
  8.     test4 = int(input('Please enter your fourth test grade: '))
  9.     testAverage = (test1+test2+test3+test4)/4
  10.  
  11.     if testAverage >=90:
  12.         print ('You have an A in the class, your test average is: ', testAverage)
  13.     if 80 <= testAverage < 90:
  14.         print ('You have a B in the class, your test average is: ', testAverage)
  15.     if 70 <= testAverage < 80:
  16.         print ('You have a C in the class, your test average is: ', testAverage)
  17.     if 60 <= testAverage < 70:
  18.         print ('You have a D in the class, your test average is: ', testAverage)
  19.     if testAverage >= 70:
  20.         print ('You have passed this course.')
  21. else:
  22.     print ('You have received an F and have failed this course.')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement