Create a method `sayHello`/`say_hello`/`SayHello` that takes as input a name, city, and state to welcome a person. Note that `name` will be an array consisting of one or more values that should be joined together with one space between each, and the length of the `name` array in test cases will vary.

Example:

```python
say_hello(['John', 'Smith'], 'Phoenix', 'Arizona')
```

This example will return the string `Hello, John Smith! Welcome to Phoenix, Arizona!`

Source: codewars | Difficulty: EASY
Tags: String algorithms

Fundamentals

Starter code: def say_hello(name, city, state):
	

Solutions:
def say_hello(name, city, state):
	return 'Hello, {}! Welcome to {}, {}!'.format(' '.join(name), city, state)


def say_hello(name, city, state):
	return f"Hello, {' '.join(name)}! Welcome to {city}, {state}!"


def say_hello(name, city, state):
	return 'Hello, %s! Welcome to %s, %s!' % (' '.join(name), city, state)


say_hello = lambda n, c, s: 'Hello, {}! Welcome to {}, {}!'.format(' '.join(n), c, s)


def say_hello(name, city, state):
	greetName = ''
	for n in name:
		if n == name[-1]:
			greetName += n
			greetName += '!'
		else:
			greetName += n
			greetName += ' '
	return 'Hello, ' + greetName + ' Welcome to ' + city + ', ' + state + '!'


from typing import List

def say_hello(name: List[str], city: str, state: str) -> str:
	return 'Hello, {n}! Welcome to {c}, {s}!'.format(n=' '.join(name), c=city, s=state)


def say_hello(name, city, state):
	string = ''.join([str(i) + ' ' for i in name])
	string_neu = string[:-1]
	city = str(city)
	state = str(state)
	return 'Hello, ' + string_neu + '! Welcome to ' + city + ', ' + state + '!'


def say_hello(name, city, state):
	aa = ' '.join(name)
	return 'Hello, ' + aa + '! Welcome to ' + city + ', ' + state + '!'


def say_hello(name, city, state):
	real_name = ''
	for n in name:
		real_name += n + ' '
	return 'Hello, {0}! Welcome to {1}, {2}!'.format(real_name[:-1], city, state)


def say_hello(name, city, state):
	names = ''
	for i in name:
		names += i + ' '
	names = names.rstrip()
	return 'Hello, {names}! Welcome to {city}, {state}!'.format(names=names, city=city, state=state)


def say_hello(name, city, state):
	str_name = ''
	for i in name:
		str_name += i + ' '
	str_name = str_name[:-1]
	return 'Hello, {name}! Welcome to {city}, {state}!'.format(name=str_name, city=city, state=state)


def say_hello(name, city, state):
	return 'Hello,' + (' {}' * len(name)).format(*name) + f'! Welcome to {city}, {state}!'


def say_hello(name, city, state):
	element = ''
	for x in name:
		element = element + x + ' '
	element = element[:-1]
	return 'Hello, ' + element + '!' + ' Welcome to ' + city + ', ' + state + '!'


def say_hello(name, city, state):
	return 'Hello, %s! Welcome to %s, %s!' % (' '.join((n for n in name)), city, state)


def say_hello(name, city, state):
	st = 'Hello, ' + ' '.join(name) + '! Welcome to ' + city + ', ' + state + '!'
	return st


def say_hello(name, city, state):
	string = ' '
	string1 = string.join(name)
	return 'Hello, {string1}! Welcome to {city}, {state}!'.format(string1=string1, city=city, state=state)


def say_hello(name, city, state):
	lis = []
	lis.append('Hello,')
	lis.append(' '.join(name) + '!')
	lis.append('Welcome to')
	lis.append(city + ',')
	lis.append(state + '!')
	return ' '.join(lis)


def say_hello(name, city, state):
	n = ''
	for el in name:
		n += ' ' + el
	return f'Hello,{n}! Welcome to {city}, {state}!'


def say_hello(name, city, state):
	fl = ' '.join((n for n in name))
	return f'Hello, {fl}! Welcome to {city}, {state}!'


def say_hello(name, city, state):
	satz = ' '.join(name)
	return 'Hello, ' + satz + '! Welcome to ' + city + ', ' + state + '!'


def say_hello(name, city, state):
	names = ' '.join(name)
	a = 'Hello, {}! Welcome to {}, {}!'.format(names, city, state)
	return a


def say_hello(name, city, state):
	separator = ' '
	name_1 = separator.join(name)
	return f'Hello, {name_1}! Welcome to {city}, {state}!'


def say_hello(name, city, state):
	full_name = ''
	for n in name:
		full_name += n
		full_name += ' '
	return 'Hello, {}! Welcome to {}, {}!'.format(full_name[:-1], city, state)


def say_hello(name, city, state):
	c = ''
	for x in name:
		c = c + x + ' '
	c = c.rstrip(' ')
	return 'Hello, ' + c + '! Welcome to ' + city + ', ' + state + '!'


def say_hello(name, city, state):
	full_name = ''
	for i in range(len(name)):
		full_name += name[i] + ' '
	if full_name[-1] == ' ':
		full_name = full_name[:-1]
	return 'Hello, {}! Welcome to {}, {}!'.format(full_name, city, state)


def say_hello(name, city, state):
	full = name[0]
	for x in range(len(name) - 1):
		full = full + ' ' + name[x + 1]
	return f'Hello, {full}! Welcome to {city}, {state}!'


def say_hello(n, c, s):
	return ''.join(f"Hello, {' '.join(n)}! Welcome to {c}, {s}!")


def say_hello(name, city, state):
	return 'Hello, ' + ' '.join((str(item) for item in name)) + '!' + ' Welcome to ' + city + ', ' + state + '!'


def say_hello(name, city, state):
	res = 'Hello, '
	for n in name:
		res += n + ' '
	res = res[:-1]
	res += '! Welcome to '
	res += city + ', '
	res += state + '!'
	return res


def say_hello(name, city, state):
	n = ''
	for i in range(len(name)):
		n = n + ' ' + name[i]
	return f'Hello, {n[1:]}! Welcome to {city}, {state}!'


def say_hello(name, city, state):
	x = ''
	for i in name:
		x += i + ' '
	y = x.strip()
	return 'Hello, {}! Welcome to {}, {}!'.format(y, city, state)


def say_hello(name, city, state):
	strname = ' '.join((str(x) for x in name))
	return 'Hello, ' + strname + '! Welcome to ' + str(city) + ', ' + str(state) + '!'


def say_hello(name, city, state):
	x = 'Hello, {}! Welcome to ' + city + ', ' + state + '!'
	temp = ''
	for i in name:
		temp += i + ' '
	temp = temp[:-1]
	z = x.format(temp)
	return z


def say_hello(name, city, state):
	nombre = ' '.join((x for x in name))
	return f'Hello, {nombre}! Welcome to {city}, {state}!'


import unittest

def say_hello(name, city, state):
	name = ' '.join(name)
	city_and_state = ', '.join([city, state])
	return f'Hello, {name}! Welcome to {city_and_state}!'

class TestSayHello(unittest.TestCase):

	def test_say_hello(self):
		(name, city, state) = (['John', 'Smith'], 'Phoenix', 'Arizona')
		actual = say_hello(name, city, state)
		self.assertEqual(actual, 'Hello, John Smith! Welcome to Phoenix, Arizona!')


def say_hello(name, city, state):
	blk = ' '
	return 'Hello, ' + blk.join(name) + '! Welcome to ' + city + ', ' + state + '!'


def say_hello(name, city, state):
	word = 'Hello, '
	for i in name:
		word += str(i) + ' '
	result = word[:-1]
	result += '! Welcome to ' + str(city) + ', ' + str(state) + '!'
	return result


def say_hello(name, city, state):
	welcome = ' Welcome to ' + city + ', ' + state + '!'
	names = ' '.join(name)
	return 'Hello, ' + names + '!' + welcome


def say_hello(name, city, state):
	str_name = ' '.join(name)
	return 'Hello, {str_name}! Welcome to {city}, {state}!'.format(str_name=str_name, city=city, state=state)
print(say_hello(['John', 'Smith'], 'Phoenix', 'Arizona'))


def say_hello(name, city, state):
	nama = ' '.join(name)
	kota = ''.join(city)
	nega = ''.join(state)
	return 'Hello, ' + nama + '! Welcome to ' + kota + ', ' + state + '!'


def say_hello(name, city, state):
	full_name = ' '.join((elt for elt in name))
	return 'Hello, %s! Welcome to %s, %s!' % (full_name, city, state)


def say_hello(name, city, state):
	full_name = ''
	for i in name:
		full_name += f' {i}'
	return f'Hello,{full_name}! Welcome to {city}, {state}!'


def say_hello(name, city, state):
	n = ''
	for i in name:
		n = n + ' ' + i
	txt = 'Hello,' + n + '! Welcome to {}, {}!'
	return txt.format(city, state)


def say_hello(name, city, state):
	a = ' '.join(name) + '!'
	r = 'Hello, ' + str(a) + ' Welcome to {}, {}!'.format(city, state)
	return ''.join(r)


def say_hello(name, city, state):
	nstr = ''
	c = city
	s = state
	for n in name:
		nstr += n + ' '
	nstr = nstr.strip()
	txt = 'Hello, {}! Welcome to {}, {}!'
	return txt.format(nstr, c, s)


def say_hello(name, city, state):
	new_name = ''
	for x in name:
		if x != name[-1]:
			new_name += x + ' '
		else:
			new_name += x
	return 'Hello, ' + new_name + '! Welcome to ' + city + ', ' + state + '!'


def say_hello(name, city, state):
	x = ' '.join(name)
	return 'Hello, ' + str(x) + '!' + ' ' + 'Welcome to ' + str(city) + ', ' + str(state) + '!'


def say_hello(name, city, state):
	name = ' '.join((part for part in name))
	return f'Hello, {name}! Welcome to {city}, {state}!'


from typing import List

def say_hello(name: List[str], city: str, state: str) -> str:
	return f"Hello, {' '.join(name)}! Welcome to {city}, {state}!"


def say_hello(name, city, state):
	space = ' '
	return 'Hello, ' + space.join(name) + '! Welcome to ' + city + ', ' + state + '!'


def say_hello(name, city, state):
	som = 'Hello, {joo}! Welcome to {naem}, {state}!'.format(joo=' '.join(name), naem=city, state=state)
	return som


def say_hello(name, city, state):
	a = ''
	for x in range(0, len(name)):
		a = a + ' ' + ''.join(name[x])
	return 'Hello, ' + a[1:] + '! Welcome to ' + city + ', ' + state + '!'


def say_hello(name, city, state):
	full_name = ''
	for (index, word) in enumerate(name):
		full_name += name[index]
		if index < len(name) - 1:
			full_name += ' '
	text = 'Hello, ' + full_name + '! Welcome to ' + city + ', ' + state + '!'
	return text


def say_hello(name, city, state):
	txt1 = 'Hello, {} {} {}! Welcome to {}, {}!'
	txt2 = 'Hello, {} {}! Welcome to {}, {}!'
	txt3 = 'Hello, {} {} {} {}! Welcome to {}, {}!'
	l = len(name)
	if l == 3:
		return txt1.format(name[0], name[1], name[2], city, state)
	elif l == 4:
		return txt3.format(name[0], name[1], name[2], name[3], city, state)
	else:
		return txt2.format(name[0], name[1], city, state)


def say_hello(name, city, state):
	x = ' '
	y = x.join(name)
	return 'Hello, {}! Welcome to {}, {}!'.format(y, city, state)


def say_hello(name, city, state):
	nam = ''
	if len(name) == 2:
		nam = name[0] + ' ' + name[1]
	elif len(name) == 3:
		nam = name[0] + ' ' + name[1] + ' ' + name[2]
	elif len(name) == 4:
		nam = name[0] + ' ' + name[1] + ' ' + name[2] + ' ' + name[3]
	elif len(name) == 5:
		nam = name[0] + ' ' + name[1] + ' ' + name[2] + ' ' + name[3] + ' ' + name[4]
	return f'Hello, {nam}! Welcome to {city}, {state}!'


def say_hello(name, city, state):
	name_join = ' '.join([x for x in name])
	sentence = 'Hello, {}! Welcome to {}, {}!'.format(name_join, city, state)
	return sentence


def say_hello(n, c, s):
	b = ''
	for i in range(len(n)):
		b += ' ' + n[i]
	return 'Hello,' + b + '! Welcome to ' + c + ', ' + s + '!'