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!"
```

Source: codewars | Difficulty: EASY
Tags: String algorithms

Fundamentals

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()
	for i in name:
		o = name[0].upper() + name[1:]
	return f'Hello {o}!'


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


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() + '!'


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 '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):
	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(n):
	return f'Hello {n.capitalize()}!'


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


def greet(name):
	return f'Hello {name.capitalize()}!'
	return 'Hello %s!' % name.capitalize()
	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):
	first_letter = name[0].upper()
	other_letters = name[1:].lower()
	return 'Hello ' + first_letter + other_letters + '!'


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


def greet(name):
	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):
	return f'hello {name}!'.title()


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):
	name = name.lower()
	names = name[0].upper()
	return 'Hello ' + names + name[1:] + '!'


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):
	d = name.title()
	return 'Hello ' + d + '!'


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


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):
	s = name[0]
	final = 'Hello ' + s.upper() + name[1:].lower() + '!'
	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:] + '!'


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):
	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):
	new = 'hello {nname}!'.format(nname=name)
	return new.title()


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


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