DEV Community

loading...

Discussion on: Daily Challenge #56 - Coffee Shop

Collapse
matrossuch profile image
Mat-R-Such

Python

def getCoffee(smallChange,type):
    menu = {'Americano' : 2.20, 'Latte' : 2.30, 'Flat white' : 2.40 , 'Filter' : 3.50}
    if sum(smallChange) == menu[type]:  return "Here is your %s, have a nice day!" %(type)
    else:   return "Sorry, exact change only, try again tomorrow!"