Skip to content

Commit 458be8f

Browse files
authored
Update Pizza order.py
1 parent 34b5562 commit 458be8f

File tree

1 file changed

+23
-29
lines changed

1 file changed

+23
-29
lines changed

Pizza order.py

Lines changed: 23 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,37 +1,31 @@
11
#Code by Ekta Kapase
2-
print("Welcome to Python Pizza Deliveries!")
3-
size = input("What size pizza do you want? S, M, or L ")
4-
add_pepperoni = input("Do you want pepperoni? Y or N ")
5-
extra_cheese = input("Do you want extra cheese? Y or N ")
2+
print("Welcome to the Love Calculator!")
3+
name1 = input("What is your name? \n")
4+
name2 = input("What is their name? \n")
65

7-
bill = 0;
6+
name1= name1.lower()
7+
name2= name2.lower()
8+
combined_name= name1 + name2
89

9-
#size
10+
count_t = combined_name.count("t")
11+
count_r = combined_name.count("r")
12+
count_u = combined_name.count("u")
13+
count_e = combined_name.count("e")
1014

11-
if size == "S":
12-
bill = 15
13-
elif size== "M":
14-
bill = 20
15-
elif size== "L":
16-
bill = 25
17-
18-
#pepperoni
19-
20-
if add_pepperoni == "Y":
21-
if size=="S":
22-
bill +=2
23-
else:
24-
bill+= 3
15+
count_l = combined_name.count("l")
16+
count_o = combined_name.count("o")
17+
count_v = combined_name.count("v")
2518

26-
#cheese
27-
28-
if extra_cheese == "Y":
29-
bill +=1
30-
31-
#final_bill
32-
33-
print(f"Your final bill is {bill}.")
34-
print("Thanks for ordering!")
3519

20+
tens_place = str(count_t + count_r + count_u + count_e)
21+
ones_place = str(count_l + count_o + count_v + count_e)
3622

23+
score = (tens_place) +(ones_place)
24+
score = int(score)
3725

26+
if 90<score<10:
27+
print(f"Your score is {score},you go together like coke and mentos.")
28+
elif 40<score<50:
29+
print(f"Your score is {score}, you are alright together.")
30+
else:
31+
print(f"Your score is {score}.")

0 commit comments

Comments
 (0)