Here's the question you clicked on:

55 members online
  • 0 replying
  • 0 viewing

WilsonWorla

  • 3 years ago

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?

  • This Question is Closed
  1. TuringTest
    • 3 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

    what kind of problem are you having with it?

  2. WilsonWorla
    • 3 years ago
    Best Response
    You've already chosen the best response.
    Medals 0

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

  3. Morries
    • 3 years ago
    Best Response
    You've already chosen the best response.
    Medals 2

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

  4. Not the answer you are looking for?
    Search for more explanations.

    • Attachments:

Ask your own question

Sign Up
Find more explanations on OpenStudy
Privacy Policy