def main():
total = 0
print('Welcome to the Dew Drop Inn!')
print('Please enter your choices as y or n.')
print(' ')
cheese = (input('Do you want a grilled cheese? '))
dog = (input('Do you want a hot dog? '))
nacho = (input('Do you want nachos? '))
burger = (input('Do you want a hamburger? '))
grilled_cheese = 5
hot_dog = 5
nachos = 4
hamburger = 6
cheese_burger = 1
if cheese == 'y':
total + grilled_cheese
if dog == 'y':
total + hot_dog
if nacho == 'y':
total + nachos
if burger == 'y':
total + hamburger
the_cheese_please = input('Do you want cheese on that? ')
if the_cheese_please == 'y':
total + cheese_burger
else:
total + 0
print(' ')
print('The total for your food is $',(total),'.')
tip = total * 1.15
main()
I need to be able to add up the numbers from the the user tells me. Depending on what food they want, how do I go about adding up the numbers using if/else statements? The max number of if's is 5 and the max number of else's is 1. I am very new at this so I apologize if this comes across as naive, but it would really help me out if someone gave me a tip on this. Thank you!
tip = total * 0.15?