Author |
Message |
Pythonsoccer
|
Posted: 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 |
|
|
|
|
![](images/spacer.gif) |
Sponsor Sponsor
![Sponsor Sponsor](templates/subSilver/images/ranks/stars_rank5.gif)
|
|
![](images/spacer.gif) |
apython1992
![](http://compsci.ca/v3/uploads/user_avatars/17001640684d87a16bb8fbb.jpg)
|
Posted: 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? |
|
|
|
|
![](images/spacer.gif) |
Pythonsoccer
|
Posted: 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 |
|
|
|
|
![](images/spacer.gif) |
apython1992
![](http://compsci.ca/v3/uploads/user_avatars/17001640684d87a16bb8fbb.jpg)
|
Posted: 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". |
|
|
|
|
![](images/spacer.gif) |
Pythonsoccer
|
Posted: 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 |
|
|
|
|
![](images/spacer.gif) |
apython1992
![](http://compsci.ca/v3/uploads/user_avatars/17001640684d87a16bb8fbb.jpg)
|
Posted: Wed Mar 23, 2011 8:50 am Post subject: RE:Python unable to add to the code |
|
|
Glad to hear. |
|
|
|
|
![](images/spacer.gif) |
|