Skip to content

Latest commit

 

History

History
41 lines (23 loc) · 631 Bytes

Jenny_s_secret_message.md

File metadata and controls

41 lines (23 loc) · 631 Bytes

CodeWars Python Solutions


Jenny's secret message

Definition

Jenny has written a function that returns a greeting for a user. However, she's in love with Johnny, and would like to greet him slightly different. She added a special case to her function, but she made a mistake.

Can you help her?


Given Code

def greet(name):
    pass

Solution

def greet(name):
    if name == "Johnny":
        return "Hello, my love!"
    else:
        return "Hello, {name}!".format(name=name)

See on CodeWars.com