Codewars 8 kyu L1: Bartender, drinks!
Task
Sort the Code
Complete the function that receives as input a string, and produces outputs.
Verbalization
Inputの文字列をすべて小文字に変える
Return each words to outputs (use dictionary)
#Code
def get_drink_by_profession(param):
param = param.lower()
dict = {
"jabroni":"Patron Tequila",
"school counselor":"Anything with Alcohol",
"programmer":"Hipster Craft Beer",
"bike gang member":"Moonshine",
"politician":"Your tax dollars",
"rapper":"Cristal"
}
val = dict.get(param, 'Beer')
return val
Reference