0

If an item to be purchased costs more than $5000 then the purchaser must go to tender (display a message), if the item costs between $500 and $5000 inclusive then the purchaser must get quotes from three different suppliers (display a message), otherwise the purchaser can just go ahead and order the item (display a message).

What I have is leaving out the last bit. I know it is something simple.

cost=int(input("Please Enter The Cost Of The Item You Wish To Purchase: "))
if cost>5000:
    print("Your Must Go To Tender")
elif cost<=500 or cost<=5000:
   print("Your Must Get 3 Different Quotes")
else:
    print("You May Order")
9
  • Yes it is something simple. Look carefully at this statement elif cost<=500 or cost<=5000: Commented Mar 3, 2019 at 13:59
  • 1
    The second case should be cost >= 500 or cost <= 5000 (or more naturally, 500 <= cost <= 5000. Commented Mar 3, 2019 at 13:59
  • 1
    @chepner - Your correction is not correct. Consider what the OP is actually trying to do in that test ..... Commented Mar 3, 2019 at 14:01
  • 1
    @StephenC Are you misreading my comment? Commented Mar 3, 2019 at 14:05
  • 1
    Ah, I'm misreading my comment :) Commented Mar 3, 2019 at 14:05

1 Answer 1

3

That's because of your elifcondition which should be:

elif cost >= 500 and cost <= 5000:
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.