Grasshopper - Personalized Message
Create a function that gives a personalized greeting. This function takes two parameters: name and owner.
Use conditionals to return the proper message:
function greet(name: string, owner: string): string {
return name === owner ? "Hello boss" : "Hello guest"
}
func greet(name string, owner string) string {
if name == owner {
return "Hello boss"
}
return "Hello guest"
}
def greet(name, owner):
return "Hello boss" if name == owner else "Hello guest"
function greet($name, $owner) {
return $name === $owner ? "Hello boss" : "Hello guest";
}
Go to Kata
Want us to give you some help with your business? No problem, here's a video on who we can help, and how, along with our calendar so you can book in a call to discuss us working together.
Let's see