Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- name = raw_input("Please enter your name, so that I know how to address you!" " ")
- semester = int(raw_input("Nice to meet you" + " " + name + ", " + "please tell me, how many semesters have you completed?" " "))
- if semester == 1 :
- num1 = float(input("Ok" + " " + name + ", " + "please enter your 1-st semester GPA: "))
- a = float(num1)/1
- if a >= 3.5 :
- print "Good job " + name + ", " + "your GPA is great!"
- if a > 3 and a <3.5 :
- print "Nice, but I am sure you can do better," + " " + name + "."
- if a <= 3 and a > 2 :
- print name + " " + "don't give up! You should try harder!"
- if a <= 2 :
- print name + " " + "you better work harder, or you will be on probation!"
- print name + "'s" + " overall GPA is" + " " + str(a)
- elif semester == 2 :
- num1 = float(input("Ok" + " " + name + ", " + "please enter your 1-st semester GPA: "))
- num2 = float(input("Enter your 2-nd semester GPA: "))
- a = float(num1 + num2)/2
- if a >= 3.5 :
- print "Good job " + name + ", " + "your GPA is great!"
- if a > 3 and a <3.5 :
- print "Nice, but I am sure you can do better," + " " + name + "."
- if a <= 3 and a > 2 :
- print name + " " + "don't give up! You should try harder!"
- if a <= 2 :
- print name + " " + "you better work harder, or you will be on probation!"
- print name + "'s" + " overall GPA is" + " " + str(a)
- elif semester == 3 :
- num1 = float(input("Ok" + " " + name + ", " + "please enter your 1-st semester GPA: "))
- num2 = float(input("Enter your 2-nd semester GPA: "))
- num3 = float(input("Enter your 3-rd semester GPA: "))
- a = float(num1 + num2 + num3)/3
- if a >= 3.5 :
- print ("Good job " + name + ", " + "your GPA is great!")
- if a > 3 and a <3.5 :
- print ("Nice, but I am sure you can do better," + " " + name + ".")
- if a <= 3 and a > 2 :
- print (name + " " + "don't give up! You should try harder!")
- if a <= 2 :
- print (name + " " + "you better work harder, or you will be on probation!")
- print(name + "'s" + " overall GPA is" + " " + str(a))
- elif semester == 4 :
- num1 = float(input("Ok" + " " + name + ", " + "please enter your 1-st semester GPA: "))
- num2 = float(input("Enter your 2-nd semester GPA: "))
- num3 = float(input("Enter your 3-rd semester GPA: "))
- num4 = float(input("Enter your 4-th semester GPA: "))
- a = float(num1 + num2 + num3 + num4)/4
- if a >= 3.5 :
- print ("Good job " + name + ", " + "your GPA is great!")
- if a > 3 and a <3.5 :
- print ("Nice, but I am sure you can do better," + " " + name + ".")
- if a <= 3 and a > 2 :
- print (name + " " + "don't give up! You should try harder!")
- if a <= 2 :
- print (name + " " + "you better work harder, or you will be on probation!")
- print(name + "'s" + " overall GPA is" + " " + str(a))
- elif semester == 5 :
- num1 = float(input("Ok" + " " + name + ", " + "please enter your 1-st semester GPA: "))
- num2 = float(input("Enter your 2-nd semester GPA: "))
- num3 = float(input("Enter your 3-rd semester GPA: "))
- num4 = float(input("Enter your 4-th semester GPA: "))
- num5 = float(input("Enter your 5-th semester GPA: "))
- a = float(num1 + num2 + num3 + num4 + num5)/5
- if a >= 3.5 :
- print ("Good job " + name + ", " + "your GPA is great!")
- if a > 3 and a <3.5 :
- print ("Nice, but I am sure you can do better," + " " + name + ".")
- if a <= 3 and a > 2 :
- print (name + " " + "don't give up! You should try harder!")
- if a <= 2 :
- print (name + " " + "you better work harder, or you will be on probation!")
- print(name + "'s" + " overall GPA is" + " " + str(a))
- elif semester == 6 :
- num1 = float(input("Ok" + " " + name + ", " + "please enter your 1-st semester GPA: "))
- num2 = float(input("Enter your 2-nd semester GPA: "))
- num3 = float(input("Enter your 3-rd semester GPA: "))
- num4 = float(input("Enter your 4-th semester GPA: "))
- num5 = float(input("Enter your 5-th semester GPA: "))
- num6 = float(input("Enter your 6-th semester GPA: "))
- a = float(num1 + num2 + num3 + num4 + num5 + num6)/6
- if a >= 3.5 :
- print ("Good job " + name + ", " + "your GPA is great!")
- if a > 3 and a <3.5 :
- print ("Nice, but I am sure you can do better," + " " + name + ".")
- if a <= 3 and a > 2 :
- print (name + " " + "don't give up! You should try harder!")
- if a <= 2 :
- print (name + " " + "you better work harder, or you will be on probation!")
- print(name + "'s" + " overall GPA is" + " " + str(a))
- elif semester == 7 :
- num1 = float(input("Ok" + " " + name + ", " + "please enter your 1-st semester GPA: "))
- num2 = float(input("Enter your 2-nd semester GPA: "))
- num3 = float(input("Enter your 3-rd semester GPA: "))
- num4 = float(input("Enter your 4-th semester GPA: "))
- num5 = float(input("Enter your 5-th semester GPA: "))
- num6 = float(input("Enter your 6-th semester GPA: "))
- num7 = float(input("Enter your 7-th semester GPA: "))
- a = float(num1 + num2 + num3 + num4 + num5 + num6 + num7)/7
- if a >= 3.5 :
- print ("Good job, " + name + ", " + "your GPA is great!")
- if a > 3 and a <3.5 :
- print ("Nice, but I am sure you can do better," + " " + name + ".")
- if a <= 3 and a > 2 :
- print (name + " " + "don't give up! You should try harder!")
- if a <= 2 :
- print (name + " " + "you better work harder, or you will be on probation!")
- print(name + "'s" + " overall GPA is" + " " + str(a))
- elif semester == 8 :
- num1 = float(input("Ok" + " " + name + ", " + "please enter your 1-st semester GPA: "))
- num2 = float(input("Enter your 2-nd semester GPA: "))
- num3 = float(input("Enter your 3-rd semester GPA: "))
- num4 = float(input("Enter your 4-th semester GPA: "))
- num5 = float(input("Enter your 5-th semester GPA: "))
- num6 = float(input("Enter your 6-th semester GPA: "))
- num7 = float(input("Enter your 7-th semester GPA: "))
- num8 = float(input("Enter your 8-th semester GPA: "))
- a = float(num1 + num2 + num3 + num4 + num5 + num6 + num7 + num8)/8
- if a >= 3.5 :
- print ("Good job, " + name + ", " + "your GPA is great!")
- if a > 3 and a <3.5 :
- print ("Nice, but I am sure you can do better," + " " + name + ".")
- if a <= 3 and a > 2 :
- print (name + " " + "don't give up! You should try harder!")
- if a <= 2 :
- print (name + " " + "you better work harder, or you will be on probation!")
- print(name + "'s" + " overall GPA is" + " " + str(a))
- else:
- print "Please enter a valid semester number e.g. 1,2,3,...7,8"
- import sys
- while True:
- print('Type q to exit.')
- response = input()
- if response == 'q':
- sys.exit()
- print('You typed ' + response + '.')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement