Ask your own question, for FREE!
Computer Science 19 Online
OpenStudy (anonymous):

name =raw_input("Enter your name: ") status =raw_input(" Enter your status") age = int(input("Enter your age: ")) totalPurchase = float(input("Enter the amount of customer's purchase: ")) if status == str("student") and age< 30: discount = 0.40 * totalPurchase else: discount = 0.05* totalPurchase elif status != str("student") and age> 65: discount = 0.70 * totalPurchase else: discount = 0.5 * totalPurchase print discount What is wrong with my program?

OpenStudy (turingtest):

what kind of problem are you having with it?

OpenStudy (anonymous):

my program doesn't run ,it says invalid syntax error where the "elif" line is.

OpenStudy (anonymous):

You have an else-if statement following an else. Put else statements last.

Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!
Can't find your answer? Make a FREE account and ask your own questions, OR help others and earn volunteer hours!

Join our real-time social learning platform and learn together with your friends!