Hi so i created a function that asks users to input their grades for a course and theoretically it should post all of the results and then the grade for the course. I have so far been able to create a function that asks the user for their information and then displays it:
def main ():
print()
a1 = getInputAsInt("What did you get on assignment 1?")
a2 = getInputAsInt("What did you get on assignment 2?")
a3 = getInputAsInt("What did you get on assignment 3?")
t1 = getInputAsInt("What did you get on test 1?")
t2 = getInputAsInt("What did you get on test 2?")
t3 = getInputAsInt("What did you get on test 3?")
ex = getInputAsInt("What did you get on the final exam?")
print()
print("The mark for assignment 1 is {numer}/{denom}".format\
(numer=a1, denom= 15))
print("The mark for assignment 2 is {numer}/{denom}".format\
(numer=a2, denom= 15))
print("The mark for assignment 3 is {numer}/{denom}".format\
(numer=a3, denom= 15))
print("The mark for test 1 is {numer}/{denom}".format\
(numer=t1, denom= 24))
print("The mark for test 2 is {numer}/{denom}".format\
(numer=t2, denom= 24))
print("The mark for test 3 is {numer}/{denom}".format\
(numer=t3, denom= 24))
print("The mark for the final exam is {numer}/{denom}".format\
(numer=ex, denom= 100))
print()
def getInputAsInt(questionForUser):
data = input(questionForUser)
data = int(data)
return data
My problem is I don't know how to get python to use the information inputted in a weighted formula to calculate grade average. I know I have to call the function somewhere within the main code to get it to follow through.
I don't want someone to do the code for me, however I would like an explanation about working with user input.
Thank you so much