Names of poets

Report a typo

You have a variable coolScope. Using one of the scope functions, count the number of letters "a" in the poet variable (case insensitive) while initializing coolScope. Also, the function should print the text "Our poet is $poet" .

Thus, you have to do two actions when initializing coolScope: initialize it with a value and print the text.

Sample Input 1:

William Blake

Sample Output 1:

Our poet is William Blake
2
Write a program in Kotlin
fun main() {
var poet: String? = readln()

val coolScope = // Write your code here

println(coolScope)
}
___

Create a free account to access the full topic