0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Codewars 8 kyu L1: Bartender, drinks!

Posted at

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

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?