John is a novice Kotlin programmer. He wants to create a function that takes a user name as input and returns a greeting message displaying that name. He wants to invoke that function with a value containing 'Kotlin Learner'. He has started the program, but some keywords and symbols are missing. Your task is to help John by filling the blanks in the code.
Invoking functions
Creating a greeting function for a username
Report a typo
Fill in the gaps with the relevant elements
greet(name: String): String {
"Hello, $name!"
}
val myName: String = "Kotlin Learner"
(greet(myName)) ___
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.
Create a free account to access the full topic
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.