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.
Computer scienceProgramming languagesKotlinObject-oriented programmingObject-oriented programming usage
Enum
Rainbow colors
Report a typo
Sample Input 1:
blueSample Output 1:
trueSample Input 2:
whiteSample Output 2:
falseWrite a program in Kotlin
fun main() {
// put your code here
}
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.