Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Python unable to add to the code
Index -> Programming, Python -> Python Help
View previous topic Printable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
Pythonsoccer




PostPosted: Tue Mar 22, 2011 8:27 am   Post subject: Python unable to add to the code

whenever i go to add to the code to finish it
it errors out and doesnt ask the question right to get the answer
Spoiler:
print "- Nikolai Vladamier's BURGER Depot -"
print "1. The Russian Burgette . . . 5.99"
print "2. Big Nikssss . . . . . . . . 3.99"
print "3. VLADS Secret Surprise . . . 1.99"
print "4. Fries . . . . . . . . . . . 1.29"
print "5. Soda Pop . . .. . . . . . . 1.19"
print "6. Exit "
print "--------------------------------------"
russianburgette = "1"
bignikssss = "2"
vladssecret = "3"
Fries = "4"
Soda = "5"
Exit = "6"
yes = "yes"
no = "no"
total = 0

while True:
order = raw_input("What Would you like to order? ")
if order == "6":
break
elif "1" in order:
total+=5.99
elif "2" in order:
total += 3.99
elif "3" in order:
total += 1.99
elif "4" in order:
total += 1.29
elif "5" in order:
total += 1.19
if "4" not in order:
print "would you like fries with that? "
if yes:
total += 1.29
elif no:
print total

print total


the point of the code is to ask the user what they would like to order and if fries arent in the order the user will be asked if they would like some but i cant get the fries part to work what so ever
Sponsor
Sponsor
Sponsor
sponsor
apython1992




PostPosted: Tue Mar 22, 2011 8:32 am   Post subject: RE:Python unable to add to the code

Welcome! When you are asking the user if he/she would like to order fries, are you currently doing anything to get user input?
Pythonsoccer




PostPosted: Tue Mar 22, 2011 8:37 am   Post subject: RE:Python unable to add to the code

ya its part of the order process but when i answer it doesnt seem to add to the total nor end the loop when told no
apython1992




PostPosted: Tue Mar 22, 2011 8:42 am   Post subject: RE:Python unable to add to the code

But I'm talking about when you ask about getting fries. Currently, you are printing the question, but there is nothing there for the user to actually input "yes" or "no".
Pythonsoccer




PostPosted: Wed Mar 23, 2011 7:45 am   Post subject: RE:Python unable to add to the code

nvm i got it
i entered another input and if statement moved to get it to work
apython1992




PostPosted: Wed Mar 23, 2011 8:50 am   Post subject: RE:Python unable to add to the code

Glad to hear.
Display posts from previous:   
   Index -> Programming, Python -> Python Help
View previous topic Tell A FriendPrintable versionDownload TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 6 Posts ]
Jump to:   


Style:  
Search: