Top.Mail.Ru
Python
? ?
LiveJournal for python.
View:Personal Journal.
View:Friends.
View:Calendar.
Missed some entries? Then simply jump to the previous day or the next day.

Thursday, March 11th, 2004

Time:8:52 pm.
hey i'm new here, just recently started using python. can anyone tell me what i'm doing wrong with the following code?
#if the user pays less than is owed, tell them how much they still owe, and input it
if cash < total:
    print "You still owe me ",total - cash
    cash = input("Amount Paid: ")
total = total + cash
print "Thank you."

#if the user pays more than is owed, give them change
elif cash > total:
    print "Thank you. Your change is ",cash - total
    
#if the user pays exactly the right amount, tell them they are owed no change
elif cash == total:
    print "Thank you. You are owed no change"
Comments: Read 8 orAdd Your Own.

LiveJournal for python.

View:User Info.
View:Friends.
View:Calendar.
View:Memories.
Missed some entries? Then simply jump to the previous day or the next day.

Image