PY
py
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
# Ballpark Orders
# https://www.sololearn.com/coach/15?ref=app
# Testing two solutions, one
# that fails test case 5.
# But they both have the same output!
from itertools import combinations_with_replacement
def his(order: str): # fails test 5
#order = input() # was
words = len(order.split())
six = (
order.count('Nachos')
+ order.count('Pizza')
)
ten = order.count('Cheeseburger')
four = order.count('Water')
five = order.count('Coke')
all_menu = six + ten + four + five
another = words - all_menu
all_price = round(1.07 * (6*six + 10*ten + 4*four + 5*(five + another)),2)
return(all_price)
Enter to Rename, Shift+Enter to Preview
OUTPUT
Run