-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPizza Order Price Calc (100 DoC) Original.py
More file actions
57 lines (48 loc) · 1.28 KB
/
Pizza Order Price Calc (100 DoC) Original.py
File metadata and controls
57 lines (48 loc) · 1.28 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
### SHORT CODE ###
# Opening Statement + collect order input
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 ")
# Calculate price
price = 0
if size == 'S':
price += 15
if add_pepperoni == 'Y':
price += 2
elif size == 'M':
price += 20
if add_pepperoni == 'Y':
price += 3
else:
price += 25
if add_pepperoni == 'Y':
price += 3
if extra_cheese == 'Y':
price += 1
# Return price
print(f"Your final bill is ${price}")
### LONG CODE ###
# 🚨 Don't change the code below 👇
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 ")
# 🚨 Don't change the code above 👆
#Write your code below this line 👇
price = 0
if size == 'S':
price += 15
if add_pepperoni == 'Y':
price += 2
elif size == 'M':
price += 20
if add_pepperoni == 'Y':
price += 3
else:
price += 25
if add_pepperoni == 'Y':
price += 3
if extra_cheese == 'Y':
price += 1
print(f"Your final bill is ${price}")