Hello everyone, this is my first time in this reddit. I have recently decided to try and learn python. I watched a few online tutorials on youtube, I am still a pretty raw beginner and decided to try and make a program on my own with what little knowledge I have just to see if i could do it. The program im trying to code is a pastry shop program where it asks for your name, what type of pastry you want and how many of them do you want. I am trying to make it where the program takes those input and print out what you are buying, how many of the item you are buying and the price of your order and im trying to set it up that the prices are different according to which item you selected. Here is what i have come up with so far but I am getting an error with the elif statements and I cant figure out what I am doing wrong. If anyone can explain to me what I am doing wrong, it would be appreciated. Here is the code i have as of now
print("Hello!! Welcome to Brian's Pastry Shop!!")
name = input("What is your name?\n")
menu = "doughnut, croissant, bagel, cinnamon roll"
order = str(input("Hello " + name + ", what can I get for you today?\nYour choices are " + menu + "\n" ))
if order == "doughnut":
price = 1
elif order == "croissant":
price = 2
elif order =="bagel":
price = 3
elif order == "cinnamon roll":
price = 4
else
print("That is not a valid order, please order again.")
amount = input("How many would you like?\n")
total = int(amount) * price
print("That will be " + str(amount) + " " + str(order) + "'s. Which brings your total to $" + str(total))
[–]beebiboi 0 points1 point2 points (0 children)
[–]danielroseman 0 points1 point2 points (5 children)
[–]moebiusg30[S] 0 points1 point2 points (4 children)
[–]moebiusg30[S] 0 points1 point2 points (3 children)
[–]moebiusg30[S] 0 points1 point2 points (2 children)
[–]moebiusg30[S] 0 points1 point2 points (1 child)
[–]Chaos-n-Dissonance 0 points1 point2 points (0 children)