# Personalized greeting

Create a function that gives a personalized greeting. This function takes two parameters: `name` and `owner`.

Use conditionals to return the proper message:

case | return
--- | ---
name equals owner | 'Hello boss'
otherwise         | 'Hello guest'

Source: codewars | Difficulty: EASY
Tags: String algorithms

Fundamentals

Starter code: def greet(name, owner):
	

Solutions:
def greet(name, owner):
	return 'Hello boss' if name == owner else 'Hello guest'


def greet(name, owner):
	return 'Hello ' + ['guest', 'boss'][name == owner]


greet = lambda n, o: 'Hello ' + 'gbuoessst'[n == o::2]


greet = lambda n, o: 'Hello {}'.format(['guest', 'boss'][n == o])


def greet(a, b):
	return 'Hello boss' if a == b else 'Hello guest'


def greet(name: str, owner: str) -> str:
	return f"Hello {('boss' if name == owner else 'guest')}"


def greet(*s):
	return f"Hello {['boss', 'guest'][len(set(s)) == len(s)]}"


def greet(name, owner):
	return 'Hello {}'.format({owner: 'boss'}.get(name, 'guest'))


greet = lambda name, owner: 'Hello %s' % ['guest', 'boss'][name == owner]


def greet(name, owner):
	n = 'boss' if name == owner else 'guest'
	return 'Hello {}'.format(n)


def greet(name, owner):
	a = name
	b = owner
	if a == b:
		return 'Hello boss'
	else:
		return 'Hello guest'


def greet(a, b):
	return 'Hello {}'.format(['guest', 'boss'][a == b])


def greet(n, r):
	return 'Hello ' + ('boss' if n == r else 'guest')


def greet(name, owner):
	if name == owner:
		x = 'boss'
	else:
		x = 'guest'
	return 'Hello {}'.format(x)


def greet(name, owner):
	if name == owner:
		print('Hello boss')
		return 'Hello boss'
	if name != owner:
		print('Hello guest')
		return 'Hello guest'


def greet(name, owner):
	if name == owner:
		return 'Hello boss'
	else:
		return 'Hello guest'
x = greet('Greg', 'Daniel')
print(x)


greet = lambda a, b: f"Hello {('boss' if a == b else 'guest')}"


import unittest
HELLO_BOSS_MSG = 'Hello boss'
HELLO_GUEST_MSG = 'Hello guest'

def greet(name, owner):
	return 'Hello boss' if name == owner else 'Hello guest'

class TestGreet(unittest.TestCase):

	def test_should_return_hello_boss_msg_when_names_equals_owner(self):
		(name, owner) = ('Daniel', 'Daniel')
		actual = greet(name, owner)
		self.assertEqual(actual, 'Hello boss')

	def test_should_return_hello_guest_msg_when_names_equals_owner(self):
		(name, owner) = ('Daniel', 'Guest')
		actual = greet(name, owner)
		self.assertEqual(actual, 'Hello guest')


def greet(name, owner):
	if name == owner:
		what = 'boss'
	else:
		what = 'guest'
	return 'Hello {}'.format(what)


greet = lambda n, o: 'Hello {0}'.format('boss' if o == n else 'guest')


def greet(n, m):
	if n == m:
		return 'Hello boss'
	return 'Hello guest'


def greet(name, name2):
	if str(name) == str(name2):
		return 'Hello boss'
	else:
		return 'Hello guest'


def greet(name, owner):
	boss = 'Hello boss'
	guest = 'Hello guest'
	if name == 'Daniel' and owner == 'Daniel':
		return boss
	else:
		return guest


def greet(name, owner):
	f_name = name.lower()
	f_owner = owner.lower()
	if f_name == f_owner:
		return 'Hello boss'
	else:
		return 'Hello guest'


def greet(name, owner):
	return f"Hello {name == owner and 'boss' or 'guest'}"


greet = lambda name, owner: 'Hello guest' if name != owner else 'Hello boss'


def greet(n, o):
	return f"Hello {('boss' if n == o else 'guest')}"


def greet(name, owner):
	re = ['Hello boss', 'Hello guest']
	return re[0] if name == owner else re[1]


def greet(name, owner):
	r = 'Hello guest'
	if name == owner:
		r = 'Hello boss'
	return r


def greet(n, o):
	return 'Hello ' + ['guest', 'boss'][n == o]


def greet(name, owner):
	x = 'boss' if name == owner else 'guest'
	return f'Hello {x}'


def greet(name, owner):
	print(name)
	print(owner)
	l = ['Daniel', 'Joe']
	return 'Hello boss' if name in l else 'Hello guest'


def greet(name, owner):
	if name != owner:
		return 'Hello guest'
	elif owner == name:
		return 'Hello boss'


def greet(name, owner):
	greeting = 'boss' if name == owner else 'guest'
	return 'Hello {greeting}'.format(greeting=greeting)


def greet(name, owner):
	return 'Hello {0}'.format('guest' if name != owner else 'boss')


def greet(name, owner):
	x = name
	y = owner
	if x == y:
		return 'Hello boss'
	else:
		return 'Hello guest'


def greet(name, owner):
	if name == owner:
		return 'Hello boss'
	elif name != owner:
		return 'Hello guest'
	else:
		return 0


def greet(name, owner):
	answer = 'Hello guest'
	if name == owner:
		answer = 'Hello boss'
	return answer


def greet(name, owner):
	if name == owner:
		return 'Hello boss'
	if name != owner:
		return 'Hello guest'
	else:
		return None
greet('Bob', 'Bob')


def greet(name, owner):
	a = 'boss' if name == owner else 'guest'
	return 'Hello {}'.format(a)


def greet(name, owner):
	if name == owner:
		return 'Hello boss'
	else:
		return 'Hello guest'
print(greet('paschoal', 'paschoal'))
print(greet('paschoal', 'morelli'))