Write a method that takes one argument as name and then greets that name, capitalized and ends with an exclamation point.

Example:

```
"riley" --> "Hello Riley!"
"JACK"  --> "Hello Jack!"
```

Difficulty: introductory

Starter code:

def greet(name):
	

Solutions:
def greet(name): 
    return f'Hello {name.title()}!'

def greet(name): 
    return f"Hello {name.capitalize()}!"

def greet(name):
    name = name.lower()
    return "Hello " + name[0].upper() + name[1:] + "!"
    
    
print((greet("BILLY")))


def greet(name): 
    name = name.lower() # Converts all letters to lowercase
    for i in name: #Loops through each letter in the given word
        o = name[0].upper() + name[1:] #Converts first letter to uppercase
    return f"Hello {o}!" 


def greet(n): 
    s = "Hello " + n.capitalize() + "!"
    return s

def greet(name): 
    return f'Hello {name.lower().title()}!'

def greet(name):
    lst = []
    lst.append(name[0].upper())
    for i in range(len(name)-1):
        lst.append(name[i+1].lower())
    return "Hello " + "".join(lst) + "!"


greet=lambda x:f"Hello {x.title()}!"

def greet(name): 
    a = (list(name))[0].upper() + ''.join((list(name))[1:]).lower()
    return "Hello {}".format(a) + "!"

def greet(name): 
    return "Hello " + "".join(name.split()).title() + "!"

def greet(name): 
   return "Hello " + name.capitalize() + "!"

def greet(name): 
    
    return "Hello " + name.title() + "!" 

greet=lambda x:f"Hello {x.capitalize()}!"

def greet(name): 
    name = name.lower()
    return "Hello {}!".format(name.replace(name[0], name[0].upper(),1))

def greet(name):
    """ Return the name with the first
    letter capitalised"""
    return 'Hello {}!'.format(name.capitalize())

print(greet('riley'))

def greet(name): 
    return f"Hello {name[0].upper() + name[1:].lower()}!"

def greet(name): 
    first = name[0].upper()
    rest = name[1:len(name)].lower()
    return 'Hello ' + first + rest + '!'

def greet(name): 
       
        name = name.lower()
        name1 = name.capitalize()
        return  f"Hello {name1}!"

def greet(name): 
    cap_name = name.capitalize()
    
    return "Hello " + cap_name + "!"

def greet(name): 
    return "Hello" + " " + name.lower().capitalize() + "!"

def greet(name): 
    # use name.lower().capitalize() to make all low case and to capitalize afterwards
    # assign Hello (the space between Hello and name) and the exclamation sign
    greet = "Hello"
    space = " "
    ex_sign = "!"
    return greet + space + name.lower().capitalize() + ex_sign

def greet(name): 
    
    new = name.lower()
    new1 = new.capitalize()
    return "Hello " + new1 + "!"

def greet(name): 
    name=''+name
    name1=name.capitalize()
    return ("Hello " + name1 + "!")

def greet(name): 
    return "Hello {}{}".format(name.capitalize(),"!")

def greet(name): 
    x = name.lower()
    t = x[1:len(name)]
    s = x[0].upper()
    return "Hello "+s+t+"!"


def greet(name): 
    
    s = "Hello "
    
    s += name.capitalize() + "!"

    return s

def greet(name): 
    a = name.capitalize()
    return ('Hello'+ ' ' + a+'!')


def greet(name): 
    name.casefold()
    return 'Hello ' + name.capitalize() + '!'

def greet(name):
    bing = name.capitalize()
    return f'Hello {bing}!'

def greet(n): 
    return f'Hello {n.capitalize()}!'

def greet(name):
    return "Hello "+str(name[0].upper())+name[1:].lower()+"!"

def greet(name): 
    # your code here
    return "{} {}{}".format('Hello', name.capitalize(), '!')

def greet(name): 
    return f'Hello {name.capitalize()}!' #or
    return 'Hello %s!' % name.capitalize() #or
    return 'Hello {}!'.format(name.capitalize())

def greet(name): 
    x = name.lower()
    x = x.title()
    return 'Hello ' + x + '!'

def greet(name): 
    name = name.capitalize()
    name = name + "!"
    ans = " ".join(["Hello",name])
    return ans 

def greet(name): 
    return f'Hello {name.title()}!' if name else None

greet = lambda name: ( (lambda cname: f'Hello {cname}!') (name.capitalize()))


greet = lambda name: f'Hello {name[0].upper()}{name[1:len(name)].lower()}!'

def greet(name): 
    lower_name = name.lower()
    return f"Hello {lower_name.title()}!"
    pass

def greet(name): 
    name = name.lower()
    name = name.capitalize()
    return 'Hello {}!'.format(name)

def greet(name): 
    result = ''
    name = name.lower().capitalize()
    result += 'Hello' + ' ' + name + '!'
    return result



def greet(name): 
    first_letter = name[0].upper()
    other_letters = name[1:].lower()
    return 'Hello ' + first_letter + other_letters + '!' 

def greet(name): 
    name = name[0].upper() + name[1:].lower()
    return f"Hello {name}!"

def greet(name): 
    fix = name.title()
    return (f'Hello {fix}!')

def greet(name):
    return f'Hello {str((name[0].upper()) + name[1:].lower())}!'

def greet(s):
    return f'Hello {s.title()}!'

def greet(name): 
    # your code here
    name=name.lower()
    ans='Hello '+name[0].upper()+name[1:len(name)]+'!'
    return ans

def greet(name):
    return "Hello " + name[0].capitalize() + name[1:].lower() + "!"

def greet(name): 
   return("Hello " + str.capitalize(name) + "!")

def greet(name): 
    name3=''
    name1=name[1:len(name)].lower()
    name2=name[0].upper()
    name3+=name2
    name3+=name1
    return ('Hello '+str(name3)+'!')

def greet(name): 
    i = name.lower()
    m = i.capitalize()
    return "Hello"+ " "+ m + "!"

def greet(name): 
    res = 'Hello ' + name[0].upper()
    for i in range(1, len(name)):
        res += name[i].lower()
    return res + '!'

def greet(name): 
    c=name.lower()
    l=[]
    for i in c:
        l.append(i)
    l[0]=l[0].upper()
    a="".join(l)
    b="Hello "+a+"!"
    return b

def greet(name): 
    lower = name.lower()
    capital = name[0].upper()
    return ('Hello ' + capital + lower[1:] + "!")


def greet(name):
    name = str(name)
    x = name.capitalize()


    return "Hello " + x + "!"

def greet(name): 
    return f'hello {name}!'.title()

def greet(name): 
    name = name.lower().capitalize()
    return "Hello" +' '+ name+"!"
    pass

def greet(name): 
    return f'Hello {name.title()}!'
print(greet("riley"))
print(greet("BILLY"))
print(greet("Mawl5y"))

def greet(name):
    greeting = '' + "Hello " +  name.capitalize() + "!"
    return greeting

def greet(name): 
    lname = name.lower()
    cname = lname.capitalize()
    return 'Hello ' + cname + '!'
    pass

def greet(name): 
    return 'Hello {name}!'.format(name=name.capitalize())

def greet(name): 
    name = name.lower()
    names = name[0].upper()
    return 'Hello ' + names + name[1:] + '!' 

def greet(name): 
    # Conversion to title case
    name = name.title()
    
    return f"Hello {name}!"

def greet(name): 
    #We'll take the input string, and convert to lower case, then capitalize it.
    return "Hello " + name.lower().capitalize() + "!"

def greet(name): 
    #We'll take the input string, and populate a variable with it.
    #At the same time, we'll turn the entire string lower case, then capitalize it.
    name = name.lower().capitalize()
    return "Hello " + name + "!"

def greet(name):
    y = name[0]
    z = name[1::]
    h = z.lower()
    u = y.upper()
    return("Hello {}!".format(u+h))

    pass

def greet(name): 
    name = name.lower()
    lowercase = ['a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j', 'k', 'l', 'm', 'n', 'o', 'p', 'q', 'r', 's', 't', 'u', 'v', 'w', 'x', 'y', 'z']
    uppercase = ['A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z']  
    for loop in range(26):
        if lowercase[loop] == name[0]:
            return f'Hello {uppercase[loop]}{name[1:]}!'

def greet(name): 
    # your code here
    d = name.title()
    return "Hello "+ d + "!"

def greet(name):
    ret=name[0].upper()+name[1:].lower()
    return f'Hello {ret}!'


def greet(name):
    nameCap = name[0].upper() + name[1:].lower()
    return (f'Hello {nameCap}!')

def greet(name): 
    # your code here
    name = name.lower()
    name = "Hello " + name.title() + "!"
    return name

def greet(name): 
    lower = name.lower()
    #print(lower)
    return 'Hello' + ' ' + lower.capitalize() + '!'
  
    
    #r = ''
    #for char in len(name):
     #   r += char
        
    #print(r[0].upper())
        #char[0].upper()
        
    
    #return 'Hello' + ' ' + name.upper() + '!'


def greet(name): 
    lower_name= name.lower()
    
    return 'Hello {}!' .format(lower_name.capitalize()) # your code here
    pass

def greet(name): 
    gr = name.lower()
    return "Hello " + gr.capitalize() + "!"


def greet(name): 
    pritty_name = name.lower().capitalize()
    return "Hello {}!".format(pritty_name)

def greet(name):
    return f"Hello {name[0].capitalize()+name[1: len(name)].lower()}!"

def greet(name): 
    name=name.capitalize()
    text="Hello "+name+"!"
    return text

def greet(name):
    return "Hello " + f'{name.capitalize()}'+'!'

def greet(name): 
    # your code here
    y = (name.lower()).capitalize()
    return "Hello " + y + "!"

def greet(name): 
    name=name[0].upper()+name[1:].lower()
    name="Hello "+name+"!"
    return name

def greet(name): 
    name = name[0].upper() + name[1:].lower() + "!"
    return "Hello " + name


def greet(name):
    s=name[0]
    final="Hello "+s.upper()+name[1:].lower()+"!"
    # your code here
    return final

def greet(name):
    x=name[0].upper()+name[1:].lower()+'!'
    return 'Hello '+x

def greet(name): 
    true_name = name[0].upper() + name[1:].lower()
    return 'Hello ' + true_name + '!'
    pass

def greet(name):
    name=name.lower()
    return 'Hello '+name[:1].upper()+name[1:]+'!'

def greet(name): 
    name = name.lower()
    return f'Hello {name[0].upper()}{name[1:]}!'

greet = lambda x: "Hello " + x[0].upper() + x[1:-1].lower() + x[-1].lower() + "!" if len(x) != 1 else "Hello " + x[0].upper() + "!"

def greet(name): 
    return f"Hello %s!" % (name.title())

def greet(name): 
    name_lower = name.lower()
    name_final = name_lower[0].upper() + name_lower[1:]
    return "Hello " + name_final + "!"


def greet(name):
    name = name.title()
    greeting = "Hello " + name + "!"
    return greeting
    pass

def greet(name): 
    name=name.lower()
    final = ('Hello ' + name[0].upper() + name[1:] + '!')
    return (final)


def greet(name): 
    new = "hello {nname}!".format(nname = name)
    return new.title()


def greet(name): 
  return 'Hello'+ ' ' +  str(name).title() + '!'

def greet(name): 
    return f'Hello {str.title(name)}!'

def greet(name):
    name = str(name).capitalize()
    return f"Hello {name}!"





def greet(name): 
    # your code here
    up_case =  name.capitalize()
    greeting = 'Hello ' + up_case + '!'
    
    return greeting

def greet(name): 
    name = name.lower()
    a = name[0].upper()
    b = list(name)
    b.pop(0)
    b = ''.join(b)
    final = a + b
    return 'Hello ' + final + '!'
    pass

def greet(name): 
    text = "Hello " + name.lower().capitalize() + "!"
    return text

def greet(name):
    result = name[0].upper()
    for i in range(1, len(name)):
        result += name[i].lower()
    return "Hello " + result + "!"