Rainbow colors

Report a typo

Write a program that reads a color name (e.g., black or orange) and prints true if that color is one of the seven colors of the rainbow — red, orange, yellow, green, blue, indigo, violet — and false otherwise.

Sample Input 1:

blue

Sample Output 1:

true

Sample Input 2:

white

Sample Output 2:

false
Write a program in Kotlin
fun main() {
// put your code here
}

Create a free account to access the full topic