Created
December 11, 2017 21:57
-
-
Save RickGriff/714abbbd4fd86e3477d2b69acd5cae98 to your computer and use it in GitHub Desktop.
Codewars Challenge 1 - Jenny's Secret Message
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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? | |
#Initial Code with Error: | |
def greet(name) | |
return "Hello, #{name}!" | |
return "Hello, my love!" if name == "Johnny" | |
end | |
#My Solution: | |
def greet(name) | |
return "Hello, my love!" if name == "Johnny" | |
"Hello, #{name}!" | |
end | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
it doesn't work as there is no function end