Create a function which answers the question "Are you playing banjo?".  
If your name starts with the letter "R" or lower case "r", you are playing banjo!

The function takes a name as its only argument, and returns one of the following strings:
```
name + " plays banjo" 
name + " does not play banjo"
```
Names given are always valid strings.

Difficulty: introductory

Starter code:

def areYouPlayingBanjo(name):
	

Solutions:
def areYouPlayingBanjo(name):
    return name + (' plays' if name[0].lower() == 'r' else ' does not play') + " banjo";

def areYouPlayingBanjo(name):
    if name[0].lower() == 'r':
        return name + ' plays banjo'
    else:
        return name + ' does not play banjo'

def areYouPlayingBanjo(name):
   return name + " plays banjo" if name[0].lower() == 'r' else name + " does not play banjo"

def areYouPlayingBanjo(name):
    if name[0].lower() == 'r':
        return "{} plays banjo".format(name)
    return "{} does not play banjo".format(name)

def areYouPlayingBanjo(name):
    if name.startswith('R') or name.startswith('r'):
        return name + ' plays banjo'
    else:
        return name + ' does not play banjo'

def areYouPlayingBanjo(name):
    if name[0] == 'r' or name[0] =='R':
        return ("%s plays banjo"%name)
    else:
        return ("%s does not play banjo"%name)

def areYouPlayingBanjo(name):
    return name + (' plays banjo' if name[0]=='r' or name[0]=='R' else ' does not play banjo')

def areYouPlayingBanjo(name):
    return '{} {}'.format(name, 'plays banjo' if name.startswith('R') or name.startswith('r') else 'does not play banjo') 


def areYouPlayingBanjo(name):
    if name[0][0] == "R":
        return name + " plays banjo"
    if name[0][0] == "r":
        return name + " plays banjo"
    else:
        return name + " does not play banjo" 


def areYouPlayingBanjo(name):
    if name[0].lower() == 'r':
        return '{} plays banjo'.format(name)
    else:
        return '{} does not play banjo'.format(name)

areYouPlayingBanjo = lambda n: n+[" does not play banjo"," plays banjo"][n[0].lower()=='r']

def areYouPlayingBanjo(name):
    for i in name:
        if i =='R' or i=='r':
            return name+ " "+"plays banjo"
        else:
            return name+" does not play banjo"

def areYouPlayingBanjo(name):
    # Implement me!
    return "{} {} banjo".format(name, "plays" if name.lower().startswith('r') else "does not play") 


def areYouPlayingBanjo(name):
    return name + (" does not play banjo", " plays banjo") [name[0].upper() == 'R']

def areYouPlayingBanjo(name):
    if name[0] in "rR":
        return "{name} plays banjo".format(name=name)
    else:
        return "{name} does not play banjo".format(name=name)

def areYouPlayingBanjo(name):
    return "{} plays banjo".format(name) if "r" == name.lower()[0] else "{} does not play banjo".format(name)

def areYouPlayingBanjo(name):
    return ['%s plays banjo' % (name), '%s does not play banjo' % (name)][name[0].lower() != 'r']

def areYouPlayingBanjo(name):
    if name.upper().startswith("R"): return name + " plays banjo"
    return name + " does not play banjo"

areYouPlayingBanjo = lambda name: (name + ' plays banjo') if name.lower()[0] == 'r' else (name + ' does not play banjo')

def areYouPlayingBanjo(name):
    return name + " plays banjo" if name[0].upper()== 'R' else name + ' does not play banjo'

def areYouPlayingBanjo(name):
    if name.startswith(("R", "r")):
        return "{} plays banjo".format(name)
    return "{} does not play banjo".format(name)

def areYouPlayingBanjo(name):
    if name[0] == 'R' or name[0] == 'r':
        return name + ' plays banjo'
    return name + ' does not play banjo'

def areYouPlayingBanjo(name):
    if name[0].lower() == 'r':
        return name + " plays banjo"
    return name + " does not play banjo"

def areYouPlayingBanjo(name):
    return name + " plays banjo" if name[0] in ('r', 'R') else name + " does not play banjo"

def areYouPlayingBanjo(name):
    
    return '{}'.format(name + (' plays banjo' if name[0] == 'R' or name[0] == 'r' else ' does not play banjo'))

def areYouPlayingBanjo(name: str) -> str:
    """ Check if the user is playing banjo based on his name. """
    return name + " plays banjo" if name.lower().startswith("r") else name + " does not play banjo"

areYouPlayingBanjo = lambda n: n + (" does not play ", " plays ")[n[0] in "Rr"] + "banjo"

def areYouPlayingBanjo(name):
    return '{} {} banjo'.format(name, ['does not play', 'plays'][name[0] in 'Rr'])

areYouPlayingBanjo=lambda n:n+[" does not play"," plays"][n[0]in'Rr']+" banjo"

def areYouPlayingBanjo(name):
    # Implement me!
    return " ".join([name, "plays" if str.upper(name[0]) == "R" else "does not play", "banjo"])

def areYouPlayingBanjo(name):
    return name+([' does not play',' plays'][name.lower().startswith('r')])+' banjo'

def areYouPlayingBanjo(name):
    status = "plays" if name[0] in "Rr" else "does not play"
    return "{n} {st} banjo".format(n = name, st = status)

areYouPlayingBanjo = lambda name: ("%s plays banjo" if name[0] in 'Rr' else "%s does not play banjo") % name

def areYouPlayingBanjo(name):
    return str(name)+(' plays banjo' if name[0]in['R','r'] else ' does not play banjo')

def areYouPlayingBanjo(name):
    # name = name.title()
    # if name.startswith('R'):
    #     return name + " plays banjo"
    # else:
    #     return name + " does not play banjo"
    return name + (" plays" if name.title().startswith('R') else " does not play") + " banjo"

def areYouPlayingBanjo(name):
    return name + (name[0] in "Rr")*" plays banjo" + (name[0] not in"Rr") * (" does not play banjo")

def areYouPlayingBanjo(name):
    return '{} {}'.format(name, ['does not play banjo', 'plays banjo'][name[0] in 'rR'])

def areYouPlayingBanjo(name):
    
    return f'{name} plays banjo' if name[0]=='R' or name[0]=='r' else f'{name} does not play banjo'

def areYouPlayingBanjo(name):
    return "{} plays banjo".format(name) if name[0] in "Rr" else "{} does not play banjo".format(name)

def areYouPlayingBanjo(name):
    return "%s %s banjo" %(name,["does not play","plays"][name[0].lower()=='r'])

def areYouPlayingBanjo(name):
    return ("{0} plays banjo" if name[0].lower() == 'r' else "{0} does not play banjo").format(name)

def areYouPlayingBanjo(name):
    # Implement me!
    return ['{} does not play banjo'.format(name), '{} plays banjo'.format(name)][name[0].lower() == 'r']

def areYouPlayingBanjo(name):
    return name + ' does not play banjo' if name[0] not in 'Rr' else name + ' plays banjo'

def areYouPlayingBanjo(name):
    if name.lower().startswith('r'):
        return f'{name} plays banjo'
    return f'{name} does not play banjo'

def areYouPlayingBanjo(name):
    return (f'{name} does not play banjo', f'{name} plays banjo')[name[0].lower() == 'r']

def areYouPlayingBanjo(name):
    banjo = ("R", "r")
    if name[0] in banjo:
        return name + " plays banjo"
    else:
        return name + " does not play banjo"

def areYouPlayingBanjo(name):
    if name.lower()[0] == 'r':
        banjo = name + " plays banjo"
    else:
        banjo = name + " does not play banjo"
    return banjo

def areYouPlayingBanjo(name):
    name_lower = name.lower()
    letters_lst = []
    for item in name_lower:
        letters_lst.append(item)
    if letters_lst[0] == "r":
        result = name + " plays banjo"
    else:
        result = name + " does not play banjo"
    return result

def areYouPlayingBanjo(name):
    # Implement me!
    if "r" in name[0] or "R" in name[0]:
        return f"{name} plays banjo"
    else:
        return f"{name} does not play banjo"


def areYouPlayingBanjo(name):
    return f"{name} plays banjo" if name.lower()[0:1] == "r" else f"{name} does not play banjo" 

def areYouPlayingBanjo(name):
    # Implement me!
    if name[0]=='R' or name[0]=="r":
        output = (name + " plays banjo")
    else:
        output = (name + " does not play banjo")
    return output

user_name = "ralan"

print(areYouPlayingBanjo(user_name))

def areYouPlayingBanjo(name):
    lst = list(name)
    if lst[0] == 'r' or lst[0] == 'R':
        return f'{name} plays banjo'
    else:
        return f'{name} does not play banjo'


areYouPlayingBanjo=lambda n:f"{n} {['does not play','plays'][n[0]in'Rr']} banjo"

def areYouPlayingBanjo(name):
    return f'{name} plays banjo' if 'r' in name[0] or 'R' in name[0] else f'{name} does not play banjo'

print("Are you playing banjo?")

def areYouPlayingBanjo(name):
    #return positive if name.lower().startswith "r"
    if name.lower().startswith("r"):
        return name + " plays banjo"
    else:
        return name + " does not play banjo"
    return name

areYouPlayingBanjo("martin")
areYouPlayingBanjo("Rikke")

def areYouPlayingBanjo(name):
    x = name.title()
    if x[0] == "R":
        return name + " plays banjo"
    else:
        return name + " does not play banjo"

def areYouPlayingBanjo(name):
    check = any(x is name[0] for x in "rR")
    return f"{name} plays banjo" if check else f"{name} does not play banjo" 




def areYouPlayingBanjo(n):
    if n[0].lower() == 'r':
        result = 'plays'
    else:
        result = 'does not play'
    return f'{n} {result} banjo'

def areYouPlayingBanjo(name):
    for i in name: 
        if i[0] == ("r") or i[0] == ("R"):
            return name + " plays banjo"
        else:
            return name + " does not play banjo"

def areYouPlayingBanjo(name):
    i = name[0:1]
    if i == "R" or i == "r":
        return f"{name} plays banjo"
    else:
        return f"{name} does not play banjo"

def areYouPlayingBanjo(name):
    if name.startswith('R'):
        return f'{name} plays banjo'
    elif name.startswith('r'):
        return f'{name} plays banjo'
    else:
        return f'{name} does not play banjo'



def areYouPlayingBanjo(name):
    if name[0]=='R' or name[0]=='r':
        stringa=str(name)+' plays banjo'
        return stringa
    stringa=str(name)+' does not play banjo'
    return stringa
    


def areYouPlayingBanjo(name):
    # Implement me!
    play=False;
    if name!='' and name[0] in ('r','R'): play=True
    
    res=name+' does not play banjo'
    if (play==True) : res=name+' plays banjo'
    return res

def areYouPlayingBanjo(name):
    
    if name.startswith("R"):
        return str(name) + " plays banjo"
    elif name.startswith("r"):
        return str(name) + " plays banjo"
    else:
        return str(name) + " does not play banjo"
    # Implement me!
    


# answer the question are you playing banjo?
# if your name starts with the letter "R" or lower case "r" you are playing banjo


def areYouPlayingBanjo(name):
    plays = " does not play banjo"
    if name[0].lower() == 'r':
        plays = " plays banjo"
    return name + plays

def areYouPlayingBanjo(name):
    return f'{name} plays banjo' if name.startswith('r') or name[0] == 'R' else f'{name} does not play banjo'

def areYouPlayingBanjo(name):
    condition = "plays" if name[0].lower()=='r' else "does not play" 
    return f"{name} {condition} banjo"

from typing import*
def areYouPlayingBanjo(name:List[str])->str:
  Yes:str = name + " plays banjo" 
  No:str = name + " does not play banjo"
  if name[0] == "r" or name[0] == "R":
    return Yes
  else:
    return No    


def areYouPlayingBanjo(name):
    list = []
    for i in name:
        list.append(i)
    if list[0] == 'R':
        return name + " plays banjo"
    elif list[0] == 'r':
        return name + " plays banjo"
    elif list[0] != 'R':
        return name + " does not play banjo"
    elif list[0] != 'r':
        return name + " does not play banjo"
    else: 
        return 'please try again michelle'

def areYouPlayingBanjo(name):
    
    nametolist = list(name)    # Converting the string to a list
    
    if nametolist[0] == 'R':    # Testing if first character is an 'R'
        return name + " plays banjo"
    elif nametolist[0] == 'r':
        return name + " plays banjo"
    else:
        return name + " does not play banjo"

def areYouPlayingBanjo(name):
    # Implement me!
    if name.upper()[0] == "R":
        text = "{} plays banjo".format(name)
    else:
        text = "{} does not play banjo".format(name)
    return text

def areYouPlayingBanjo(name):
    plays = "does not play" if name[0] not in "Rr" else "plays"
    return f"{name} {plays} banjo"

import re
def areYouPlayingBanjo(name):
    return name+" plays banjo" if re.search("\A[rR]",name) else name+" does not play banjo"

def areYouPlayingBanjo(name):
    # Implement me!
    
    a = name + " plays banjo" 
    b = name + " does not play banjo"
    
    
    if name[0] == "r" or name[0] == "R":
        return a
    
    else: return b


def areYouPlayingBanjo(name):
    # Implement me!
    result = " plays banjo" if name.lower()[0] == 'r' else " does not play banjo"
    return name + result

def areYouPlayingBanjo(name):
    return name + " does not play banjo" if name[0] != 'R' and name[0] != 'r' else name + " plays banjo" 
    
    


def areYouPlayingBanjo(name):
    first = name[0]
    if first == "R":
        return(name + " "+ "plays banjo")
    elif first == "r":
        return(name + " " + "plays banjo")
    else :
        return(name + " "+ "does not play banjo")
print(areYouPlayingBanjo("Martin"))

def areYouPlayingBanjo(name):
    result = ""
    if name[0] == "r" or name[0] == "R":
        result += " plays banjo"
    else:
        result += " does not play banjo"
        
    return name+ result

def areYouPlayingBanjo(name):
    return f"{name} plays banjo" if name[0].lower().startswith("r") else f"{name} does not play banjo"

def areYouPlayingBanjo(name):
    checkname=name.lower()
    if checkname.startswith('r'):
        return  name + " plays banjo" 
    else:
        return  name + " does not play banjo" 


def areYouPlayingBanjo(name):
    first_letter= name[0]
    if first_letter == 'R':
        return name + ' plays banjo'
    elif first_letter == 'r':
        return name + ' plays banjo'
    return name + ' does not play banjo'
        


def areYouPlayingBanjo(name):
    return name + (" plays banjo" if name[:1] in 'rR' else " does not play banjo")

def areYouPlayingBanjo(name):
    first_letter= list(name)[0].lower()
    if first_letter == 'r':
        return(name + " plays banjo")
    return(name + " does not play banjo")

def areYouPlayingBanjo(name):
    if name[0] == "r": 
        return name +" "+ "plays banjo"
    elif name[0] == "R":
        return name +" "+ "plays banjo"
    return name +" "+"does not play banjo"


def areYouPlayingBanjo(name):
    if name.startswith(("R", "r")):
        return f'{name} plays banjo'
    else:
        return f'{name} does not play banjo'



def areYouPlayingBanjo(name):
    return f"{name} {'plays' if name.lower().startswith('r') else 'does not play'} banjo"

def areYouPlayingBanjo(name):
    b=' plays banjo'
    nb=' does not play banjo'
    if name[0].lower()== 'r':
        name = name + b
        return name
    else:
        name = name + nb
        return name

def areYouPlayingBanjo(name):
    return name + r' plays banjo' if name[0].lower() == 'r' else name + r' does not play banjo'

areYouPlayingBanjo = lambda n: f"{n} plays banjo" if n[0] is 'r' or n[0] is 'R' else f"{n} does not play banjo"

def areYouPlayingBanjo(name):
    # Implement me!
    list()
    if name[0] == "R" or name[0] == "r":
        return str(name) + " plays banjo"
    else:
        return str(name) + " does not play banjo"

def areYouPlayingBanjo(name):
    return '%s plays banjo' % name if name[0].lower() == 'r' else \
        '%s does not play banjo' % name

def areYouPlayingBanjo(name):
    # Implement me!
    if name[0]=="r" or name[0]=="R":
        ret=name+" plays banjo"
    else:
        ret=name+" does not play banjo"
    return ret


def areYouPlayingBanjo(name):
    output = ''
    if name.lower()[0] == 'r':
        output = ' plays banjo'
    else:
        output = ' does not play banjo'
    return name + output

areYouPlayingBanjo = lambda x: '{} plays banjo'.format(x) if x and x[0].lower()=='r' else '{} does not play banjo'.format(x)

def areYouPlayingBanjo(name):
    return name + [" does not play", " plays"][name[0].startswith(('R', 'r'))] + " banjo"

def areYouPlayingBanjo(name):
    i = 'rR'
    return f'{name} plays banjo' if name[0] in i else f'{name} does not play banjo'

def areYouPlayingBanjo(name):
    first_letter = name[0]
    print(first_letter)
    if first_letter == "R" or first_letter == "r":
        return name + " plays banjo" 
    return name + " does not play banjo"

def areYouPlayingBanjo(name):
    plays = name[0].upper() == "R"
    answer = ["does not play", "plays"]
    return f"{name} {answer[plays]} banjo"

def areYouPlayingBanjo(name):
    if list(name)[0] == 'R' or list(name)[0] == 'r':
        return f"{name} plays banjo"
    else:
        return f"{name} does not play banjo"

def areYouPlayingBanjo(name):
    if name.casefold().startswith("r"):
        return f"{name} plays banjo"
    else:
        return f"{name} does not play banjo"