반응형
S_PIZZA = 15
print("Welcome to Python Pizza Deliveries!")
size = input("What size pizza do you want? S, M, or L ")
add_pepperoni = input("Do you want pepperoni? Y or N ")
extra_cheese = input("Do you want extra cheese? Y or N ")
if size == 'S':
if add_pepperoni == 'Y':
S_PIZZA += 2
if extra_cheese == 'Y':
S_PIZZA += 1
elif size == 'M':
S_PIZZA +=5
if add_pepperoni == 'Y':
S_PIZZA += 3
if extra_cheese == 'Y':
S_PIZZA += 1
else:
S_PIZZA +=10
if add_pepperoni == 'Y':
S_PIZZA += 3
if extra_cheese == 'Y':
S_PIZZA += 1
print(f"Your final bill is: ${S_PIZZA}")
반응형
'파이썬 > exercise' 카테고리의 다른 글
3-4 python treasure island (0) | 2022.12.27 |
---|---|
3-3 python love calulator (0) | 2022.12.27 |
2-3 python tip calculator (0) | 2022.12.27 |
2-2 python 남은 삶 계산 (0) | 2022.12.27 |
2-1/3-1 python BMI calculator (0) | 2022.12.27 |