# 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'

Difficulty: introductory

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 {}".format("boss" if name == owner else "guest")

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

def greet(name, owner):
    if name == owner:
        return "Hello boss"
    else:
        return "Hello guest"
#Completed by Ammar on 25/8/2019 at 03:24AM.


def greet(name, owner):
    if (name == owner):
        return 'Hello boss'
    else:
        return '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(name, owner):
    return 'Hello ' + ('guest' if name!=owner else 'boss')

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

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

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

def greet(name: str, owner: str) -> str:
    """ Get personalized greeting based on passed `name` and `owner`. """
    return f"Hello {'boss' if name == owner else 'guest'}"

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

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

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

def greet(name, owner):
    return ("Hello boss", "Hello guest")[name != owner]

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

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

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

greet = lambda name, owner: "Hello %s"%(["guest", "boss"][name == owner])

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

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(name, owner):
    return " ".join(["Hello","boss" if owner == name else "guest"])

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

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

def greet(name, owner):
    string = ""
    if name == owner:
        string += "boss"
    else:
        string += "guest"
    return "Hello " + string

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

def greet(name, owner):
    "Приветствуем Бoсса"
    return 'Hello boss' if name == owner else 'Hello guest'

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

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

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


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

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

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):
    # Add code here
    #name = input()
    #owner = input()
    if name == owner:
        return "Hello boss"
    else:
        return 'Hello guest'

def greet(name, owner):
    # Add code here
    if name==owner:
        what = "boss"
    else:
        what = "guest"
    return "Hello {}".format(what)

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

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, owner):
    if name == owner:
        return f'Hello boss'
    else:
        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):
    # Add code here
    if name == owner:
        return 'Hello boss'
    else:
        return 'Hello guest'
        

greet('Vasya','Vasya') 

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(name, owner):
    return 'Hello boss' if name == owner else 'Hello guest'
    # self


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):
    # Add code here
    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):
    # Add code here
    name.lower()
    owner.lower()
    if name==owner:
        return ('Hello boss')
    else:
        return ('Hello guest')

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

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

def greet(name, owner):
    # Add code here
    if name == owner:
        return('Hello boss')
    else:
        return('Hello guest')
        
greet('Daniel', 'Greg')

def greet(name, owner):
    if name == owner:
        result = "boss"
    else:
        result = "guest"
    return "Hello " + result
    # Add code here


def greet(name, owner):
    # Add code here
    name=name.lower()
    owner=owner.lower()
    if name==owner:
        return 'Hello boss'
    else:
        return 'Hello guest'

def greet(name, owner):
  greetings = ["Hello boss", "Hello guest"]

  return greetings[0] if name == owner else greetings[1]


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

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

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


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

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

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

def greet(name, owner):
    return 'Hello ' + 'boss'*(name==owner) + 'guest'*(name!=owner)

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

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


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

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

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


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

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

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

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

def greet(name, owner):
    if name == owner:
        return 'Hello boss'
    else:
        return 'Hello guest'
    return greet + " , Hello guest"
    
    
# (f'greet, {name     


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

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):
    #print(name, owner)
    if name == owner:
        return("Hello boss")
    else:
        return("Hello guest")

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

print(greet(a,b))

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

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

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

def greet(n, o):
    if n == o:
        return "Hello boss"
    return "Hello guest"



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

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