I'm currently learning to program in python and I was wondering what is the correct syntax for comparing two strings.
I'm trying to compare the user input and decide whether it is a specific string so I could do certain calculations. Why does the following not work?
user_input = raw_input("Please enter a list of numbers: ")
user_input2 = raw_input("What do you want to calculate? ")
grades = user_input.split(',')
............
stuff
............
if user_input2 == 'sum'
print grades_sum(grades)
elif user_input2 == 'avg'
print grades_average(grades)
else
print grades_std_deviation(variance)
Aucun commentaire:
Enregistrer un commentaire