My friend wants a new band name for her band. She like bands that use the formula: "The" + a noun with the first letter capitalized, for example:

`"dolphin" -> "The Dolphin"`

However, when a noun STARTS and ENDS with the same letter, she likes to repeat the noun twice and connect them together with the first and last letter, combined into one word (WITHOUT "The" in front), like this:

`"alaska" -> "Alaskalaska"`

Complete the function that takes a noun as a string, and returns her preferred band name written as a string.

Source: codewars | Difficulty: EASY
Tags: Fundamentals

Starter code: def band_name_generator(name):
	

Solutions:
def band_name_generator(name):
	return name.capitalize() + name[1:] if name[0] == name[-1] else 'The ' + name.capitalize()


def band_name_generator(name):
	if name[0] == name[-1]:
		return name.title() + name[1:]
	return ('the ' + name).title()


def band_name_generator(name):
	if name[0] != name[-1]:
		return '{}{}{}'.format('The ', name[0].upper(), name[1:])
	else:
		return '{}{}{}'.format(name[0].upper(), name[1:], name[1:])


def band_name_generator(name):
	return name.capitalize() + name[1:] if name.startswith(name[0]) and name.endswith(name[0]) else 'The ' + name.capitalize()


def band_name_generator(name):
	return name.title() if len(name) == 1 else name.title()[:-1] + name if name[0] == name[-1] else 'The ' + name.title()


def band_name_generator(s):
	return (('The ' if s[0] != s[-1] else s[:-1]) + s).title()


band_name_generator = lambda s: (['the ', s[:-1]][s[0] == s[-1]] + s).title()