I have this code:
tot_l_cap = 0
tot_r_cap = 0
tot_l_esp = 0
tot_r_esp = 0
tot_l_lat = 0
tot_r_lat = 0
tot_l_iced_c_ic = 0
tot_r_iced_c_ic = 0
tot_l_iced = 0
tot_r_iced = 0
print('Please enter all choices with the integer they are associated with.')
def coff_menu():
print('-------------------------------------------------------------------------------------------------')
print('1. Cappuccino: |Regular: $4.40 |Large: $4.95')
print('-------------------------------------------------------------------------------------------------')
print('2. Espresso: |Regular: $3.60 |Large: $4.15')
print('-------------------------------------------------------------------------------------------------')
print('3. Latte: |Regular: $3.85 |Large: $4.40')
print('-------------------------------------------------------------------------------------------------')
print('4. Iced Coffee With ice-cream and cream: |Regular: $4.40 |Large: $4.95')
print('5. Iced Coffee Without: |Regular: $3.85 |Large: $4.40' )
print('-------------------------------------------------------------------------------------------------')
def order():
coff_menu()
coff_type = int(input("What coffee would you like to order? "))
coff_size = input('Would you like the size to be regular or large? ')
quant_coff = int(input("How many would you like to order? "))
return coff_type, coff_size, quant_coff
def cap_order():
if coff_type == '1':
if coff_size == 'Large':
price = 4.95 * quant_coff
tot_l_cap += cost
elif coff_size == 'Regular':
price = 4.40 * quant_coff
tot_r_cap += cost
return cost
I get errors that tell me that coff_type
, coff_size
and quant_coff
are not defined within def cap_order
. Why? How can I fix the problem?