Write a function `getDrinkByProfession`/`get_drink_by_profession()` that receives as input parameter a string, and produces outputs according to the following table:




Input
Output


"Jabroni"
"Patron Tequila"


"School Counselor"
"Anything with Alcohol"


 "Programmer"
 "Hipster Craft Beer"


 "Bike Gang Member"
"Moonshine" 


 "Politician"
"Your tax dollars" 


 "Rapper"
"Cristal" 


 *anything else* 
"Beer" 





Note: *anything else* is the default case: if the input to the function is not any of the values in the table, then the return value should be "Beer."

Make sure you cover the cases where certain words do not show up with correct capitalization. For example, getDrinkByProfession("pOLitiCIaN") should still return "Your tax dollars".

Difficulty: introductory

Starter code:

def get_drink_by_profession(param):
	

Solutions:
d = {
    "jabroni": "Patron Tequila",
    "school counselor": "Anything with Alcohol",
    "programmer": "Hipster Craft Beer",
    "bike gang member": "Moonshine",
    "politician": "Your tax dollars",
    "rapper": "Cristal"
}

def get_drink_by_profession(s):
    return d.get(s.lower(), "Beer")

def get_drink_by_profession(param):
    return {
        "Jabroni": "Patron Tequila",
        "School Counselor": "Anything with Alcohol",
        "Programmer": "Hipster Craft Beer",
        "Bike Gang Member": "Moonshine",
        "Politician": "Your tax dollars",
        "Rapper": "Cristal"
    }.get(param.title(), "Beer")

def get_drink_by_profession(param):
    d = {"Jabroni":"Patron Tequila", "School Counselor":"Anything with Alcohol", "Programmer":"Hipster Craft Beer", "Bike Gang Member":"Moonshine", "Politician":"Your tax dollars", "Rapper":"Cristal"}
    if param.title() in d:
        return d[param.title()]
    else:
        return "Beer"

def get_drink_by_profession(param):
    newparam = param.lower()
    
    if newparam == 'jabroni':
        return 'Patron Tequila'
    elif newparam == 'school counselor':
        return 'Anything with Alcohol'
    elif newparam == 'programmer':
        return 'Hipster Craft Beer'
    elif newparam == 'bike gang member':
        return "Moonshine"
    elif newparam == 'politician':
        return "Your tax dollars"
    elif newparam == "rapper":
        return "Cristal"
    else:
        return "Beer"

CLICHES = {
    "jabroni": "Patron Tequila",
    "school counselor": "Anything with Alcohol",
    "programmer": "Hipster Craft Beer",
    "bike gang member": "Moonshine",
    "politician": "Your tax dollars",
    "rapper": "Cristal",
}

def get_drink_by_profession(param):
    return CLICHES.get(param.lower(), "Beer")

get_drink_by_profession=lambda p: {"Jabroni":"Patron Tequila", "School Counselor":"Anything with Alcohol", "Programmer":"Hipster Craft Beer", "Bike Gang Member":"Moonshine", "Politician":"Your tax dollars",  "Rapper":    "Cristal"}.get(p.title(), "Beer")

def get_drink_by_profession(param):
    #This function receives an input parameter and produces the corresponding output

    #Step 1 - Produce a dictionary
    Drinks = {'jabroni':'Patron Tequila',
            'school counselor':'Anything with Alcohol',
            'programmer':'Hipster Craft Beer',
            'bike gang member':'Moonshine',
            'politician':'Your tax dollars',
            'rapper':'Cristal'}
    #Step 2 - Turn input to lower case

    profession = param.lower()

    #Step 3 - A for loop that cycles through the keys and has conditional statement

    for key in Drinks:
        if key == profession:
            return Drinks[key]
    
    return 'Beer'

def get_drink_by_profession(param):
    param = param.title()
    menu = {'Jabroni': 'Patron Tequila', 'School Counselor': 'Anything with Alcohol', 'Programmer': 'Hipster Craft Beer', 'Bike Gang Member': 'Moonshine', 'Politician': 'Your tax dollars', 'Rapper': 'Cristal'}
    if param in menu.keys():
        return menu[param]
    else:
        return "Beer"

get_drink_by_profession = \
    lambda param: \
    (
        {
            'jabroni': 'Patron Tequila',
            'school counselor': 'Anything with Alcohol',
            'programmer': 'Hipster Craft Beer',
            'bike gang member': 'Moonshine',
            'politician': 'Your tax dollars',
            'rapper': 'Cristal',
        }
        .get(param.lower(), 'Beer')
    )

def get_drink_by_profession(param):
    if param.lower() in ["jabroni"]:
        return "Patron Tequila"; 
    elif param.lower() in ["school counselor"]:
        return "Anything with Alcohol"; 
    elif param.lower() in ["programmer"]:
        return "Hipster Craft Beer";  
    elif param.lower() in ["bike gang member"]:
        return "Moonshine"; 
    elif param.lower() in ["rapper"]:
        return "Cristal";
    elif param.lower() in ["politician"]:
        return "Your tax dollars";     
    else:
        return "Beer"; 

get_drink_by_profession=lambda x:{"jabroni":"Patron Tequila","school counselor":"Anything with Alcohol","programmer":"Hipster Craft Beer","bike gang member":"Moonshine","politician":"Your tax dollars","rapper":"Cristal"}.get(x.lower())or"Beer"

def get_drink_by_profession(param):
    # code me! hell yeah
    return {'jabroni':'Patron Tequila',
    'school counselor':'Anything with Alcohol',
    'programmer':'Hipster Craft Beer',
    'bike gang member':'Moonshine',
    'politician':'Your tax dollars',
    'rapper':'Cristal'
    }.get(param.lower(), 'Beer')

def get_drink_by_profession(param):
    param = param.lower().title()
    L = ["Jabroni", "School Counselor",  "Programmer", "Bike Gang Member",  "Politician", "Rapper"]
    L1 =["Patron Tequila", "Anything with Alcohol", "Hipster Craft Beer", "Moonshine", "Your tax dollars", "Cristal"]
    if param in L :
        n = L.index(param)
        return L1[n]
    else : return "Beer"

def get_drink_by_profession(param):
    # code me!
    drinkList = { "jabroni": "Patron Tequila"
                 ,"school counselor":"Anything with Alcohol"
                 ,"programmer":"Hipster Craft Beer"
                 ,"bike gang member":"Moonshine"
                 ,"politician":"Your tax dollars"
                 ,"rapper":"Cristal"
                 }
    return drinkList[param.lower()] if param.lower() in list(drinkList.keys()) else "Beer"
                 


table = {
    "jabroni": "Patron Tequila",
    "school counselor": "Anything with Alcohol",
    "programmer": "Hipster Craft Beer",
    "bike gang member": "Moonshine",
    "politician": "Your tax dollars",
    "rapper": "Cristal",
}

def get_drink_by_profession(param):
    return table.get(param.lower(), "Beer")   

def get_drink_by_profession(id):
    switch = {
        "jabroni": "Patron Tequila",
        "school counselor": "Anything with Alcohol",
        "programmer": "Hipster Craft Beer",
        "bike gang member": "Moonshine",
        "politician": "Your tax dollars",
        "rapper": "Cristal"
    }
    
    return switch.get(id.lower(), "Beer") # id en minisculas, si no existe dentro de switch, devuelve "Beer"

def get_drink_by_profession(param):
    param = param.lower()
    switch = {
        "jabroni":  "Patron Tequila",
        "school counselor": "Anything with Alcohol",
        "programmer":    "Hipster Craft Beer",
        "bike gang member":     "Moonshine",
        "politician":   "Your tax dollars",
        "rapper":   "Cristal"
    }
    return switch.get(param, "Beer")

def get_drink_by_profession(param):
    if param.lower() == 'jabroni':
        return 'Patron Tequila'
    if param.lower() == 'school counselor':
        return 'Anything with Alcohol'
    if param.lower() == 'programmer':
        return 'Hipster Craft Beer'
    if param.lower() == 'bike gang member':
        return 'Moonshine'
    if param.lower() == 'politician':
        return 'Your tax dollars'
    if param.lower() == 'rapper':
        return 'Cristal'
    else:
        return 'Beer'
        


def get_drink_by_profession(param):
    param=param.lower()
    if "jabroni" in param:
        return "Patron Tequila"
    if param== "school counselor":
        return "Anything with Alcohol"
    if param== "programmer":
        return "Hipster Craft Beer"
    if param=="bike gang member":
        return "Moonshine" 
    if param=="politician":
       return "Your tax dollars" 
    if param=="rapper":
       return "Cristal" 
    return "Beer"

def get_drink_by_profession(param):
    drinks = {
        "jabroni": "Patron Tequila",
        "school counselor": "Anything with Alcohol",
        "programmer": "Hipster Craft Beer",
        "bike gang member": "Moonshine",
        "politician": "Your tax dollars",
        "rapper": "Cristal",
    }
    return drinks.get(param.lower(), "Beer")

DCT = {"jabroni" :  "Patron Tequila",
       "school counselor" : "Anything with Alcohol",
       "programmer" : "Hipster Craft Beer",
       "bike gang member": "Moonshine",
       "politician" : "Your tax dollars",
       "rapper" : "Cristal"}

def get_drink_by_profession(param):
    return DCT.get(param.lower(),'Beer')

KNOWN_DRINK_PREFERENCES = { "zaphod beeblebrox" : "Intergalactic Gargle-Blaster",
                            "school counselor"  :        "Anything with Alcohol",
                            "programmer"        :           "Hipster Craft Beer",
                            "politician"        :             "Your tax dollars",             
                            "jabroni"           :               "Patron Tequila",
                            "bike gang member"  :                    "Moonshine",
                            "rapper"            :                      "Cristal",
                            "nero"              :                         "Wine" }

get_drink_by_profession = lambda p: KNOWN_DRINK_PREFERENCES.get(p.lower(), "Beer")

def get_drink_by_profession(param):
    param = param.lower()
    iput = {
    "jabroni": "Patron Tequila",
    "school counselor": "Anything with Alcohol",
    "programmer": "Hipster Craft Beer",
    "bike gang member": "Moonshine",
    "politician": "Your tax dollars",
    "rapper": "Cristal"}
    if param in iput:
        return iput[param]
    else:
        return "Beer"

def get_drink_by_profession(param):

    shite =  {"Jabroni":    "Patron Tequila", "School Counselor":   "Anything with Alcohol", "Programmer":   "Hipster Craft Beer", "Bike Gang Member":  "Moonshine",  "Politician":     "Your tax dollars",  "Rapper":  "Cristal"} 
     
    return shite.get(param.title(), "Beer")

def get_drink_by_profession(param):
    drinks = {
        "Jabroni": "Patron Tequila",
        "School Counselor": "Anything with Alcohol",
        "Programmer": "Hipster Craft Beer",
        "Bike Gang Member": "Moonshine",
        "Politician": "Your tax dollars",
        "Rapper": "Cristal"
    }
    try:
        answer = drinks[param.title()]

    except:
        answer = "Beer"

    return answer


def get_drink_by_profession(param):
    param_1 = param.lower()
    if param_1 == "jabroni":
        return "Patron Tequila"
    if param_1 == "school counselor":
        return  "Anything with Alcohol"
    if param_1 == "programmer":
        return "Hipster Craft Beer"
    if param_1 ==  "bike gang member":
        return "Moonshine" 
    if param_1 == "politician":
        return  "Your tax dollars" 
    if param_1 == "rapper":
        return "Cristal"
    else:
        return "Beer"
        


def get_drink_by_profession(param):
    d = {"jabroni": "Patron Tequila", "school counselor" : "Anything with Alcohol", "programmer" : "Hipster Craft Beer", "bike gang member" : "Moonshine", "politician":"Your tax dollars", "rapper":"Cristal", "anything else":"Beer"}
    return d[param.lower()] if param.lower() in d else "Beer"

def get_drink_by_profession(param):
    dict = {"Jabroni" : "Patron Tequila", 
            "School counselor" : "Anything with Alcohol",
            "Programmer" : "Hipster Craft Beer",
            "Bike gang member" : "Moonshine",
            "Politician" : "Your tax dollars",
            "Rapper" : "Cristal"} 
    param = param.capitalize()
    if param in dict:
        return dict[param]
    return "Beer"

thisdict = {
    "Jabroni": "Patron Tequila",
    "School Counselor": "Anything with Alcohol",
    "Programmer": "Hipster Craft Beer",
    "Bike Gang Member": "Moonshine",
    "Politician": "Your tax dollars",
    "Rapper": "Cristal"
    }

def get_drink_by_profession(param):
    formatted= param.title()
    drink="Beer"
    if formatted in thisdict:
        drink = thisdict.get(formatted)
    return(drink)


def get_drink_by_profession(param):
    drink_dic = {'Jabroni': 'Patron Tequila', 'School Counselor': 'Anything with Alcohol',
                'Programmer': 'Hipster Craft Beer', 'Bike Gang Member': 'Moonshine',
                'Politician': 'Your tax dollars', 'Rapper': 'Cristal'}
    return drink_dic[param.title()] if param.title() in drink_dic else 'Beer'

def get_drink_by_profession(param):
    client_drink = {
        "jabroni":"Patron Tequila",
        "school counselor":"Anything with Alcohol",
        "programmer":"Hipster Craft Beer",
        "bike gang member":"Moonshine",
        "politician":"Your tax dollars",
        "rapper":"Cristal",
    }
    return client_drink[param.lower()] if param.lower() in client_drink else "Beer"

def get_drink_by_profession(param):
    drinks = {
        "jabroni" : "Patron Tequila",
        "school counselor" : "Anything with Alcohol",
        "programmer" : "Hipster Craft Beer",
        "bike gang member" : "Moonshine",
        "politician" : "Your tax dollars",
        "rapper" : "Cristal",
    }
    if param.lower() in drinks:
        return drinks.get(param.lower())
    else:
        return "Beer"
    
    


def get_drink_by_profession(param):
    p = param.lower()
    bartender={
        "jabroni":"Patron Tequila",
        "school counselor":"Anything with Alcohol",
        "programmer":"Hipster Craft Beer",
        "bike gang member": "Moonshine",
        "politician" : "Your tax dollars",
        "rapper" : "Cristal",
        "anything else": "Beer"

    }
    if p in bartender:
            return bartender[p]
    else:
        return "Beer"

    # code me!


def get_drink_by_profession(param):
    drink_dict = {
        "Jabroni": "Patron Tequila",
        "School Counselor": "Anything with Alcohol",
        "Programmer":  "Hipster Craft Beer",
        "Bike Gang Member": "Moonshine",
        "Politician": "Your tax dollars",
        "Rapper": "Cristal",
        "anything else": "Beer"     
    }
    param = param.title()
    if param in drink_dict.keys():
        return drink_dict[param]
    else:
        return "Beer"

def get_drink_by_profession(param):
    param = param.lower()
    
    profs = {
        "jabroni": "Patron Tequila", 
        "school counselor": "Anything with Alcohol", 
        "programmer": "Hipster Craft Beer",
        "bike gang member": "Moonshine",
        "politician": "Your tax dollars",
        "rapper": "Cristal"
    }
    
    if param in profs:
        return profs[param]
    else:
        return "Beer"

def get_drink_by_profession(param=''):
    if param.title() == "Jabroni":
        return "Patron Tequila"
    elif param.title() == "School Counselor":
        return "Anything with Alcohol"
    elif param.title() ==  "Programmer":
        return  "Hipster Craft Beer"
    elif param.title() ==  "Bike Gang Member":
        return "Moonshine" 
    elif param.title() == "Politician":
        return "Your tax dollars" 
    elif param.title() == "Rapper":
        return "Cristal"
    else:
        return "Beer"


def get_drink_by_profession(param):
    drink_list = {'Jabroni': 'Patron Tequila',
                  'School Counselor': "Anything with Alcohol",
                  'Programmer': 'Hipster Craft Beer',
                  'Bike Gang Member': 'Moonshine',
                  'Politician': 'Your tax dollars',
                  'Rapper': 'Cristal',}
    param = param.title()
    try:
        return (drink_list)[param]
    except:
        return 'Beer'


def get_drink_by_profession(param):
    jobName = param.upper()
    if jobName == "JABRONI":
        return "Patron Tequila"
    elif jobName == "SCHOOL COUNSELOR":
        return "Anything with Alcohol"
    elif jobName == "PROGRAMMER":
        return "Hipster Craft Beer"
    elif jobName == "BIKE GANG MEMBER":
        return "Moonshine"
    elif jobName == "POLITICIAN":
        return "Your tax dollars"
    elif jobName == "RAPPER":
        return "Cristal"
    else:
        return "Beer"

def get_drink_by_profession(param = 'anything else'):
    switcher = { 
        'Jabroni': 'Patron Tequila', 
        'School Counselor': 'Anything with Alcohol', 
        'Programmer': 'Hipster Craft Beer',
        'Bike Gang Member' : 'Moonshine',
        'Politician' : 'Your tax dollars',
        'Rapper' : 'Cristal',
    } 
    return switcher.get(param.lower().title(), 'Beer')

def get_drink_by_profession(param):
    dct = {"Jabroni": "Patron Tequila",
           "School Counselor":  "Anything with Alcohol",
           "Programmer": "Hipster Craft Beer",
           "Bike Gang Member": "Moonshine", 
           "Politician": "Your tax dollars",
           "Rapper": "Cristal"}
    return dct[param.title()] if param.title() in dct else 'Beer'