Skip to content

Instantly share code, notes, and snippets.

@shakyra
Last active January 16, 2023 22:11
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shakyra/6b6fec91c58be51d3d88edfc68d4e8a7 to your computer and use it in GitHub Desktop.
Save shakyra/6b6fec91c58be51d3d88edfc68d4e8a7 to your computer and use it in GitHub Desktop.
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'
func great(_ name: String, _ owner: String) -> String {
// complete this function
if name == owner {
return("Hello boss")
}
else {
return("Hello guest")
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment