-
-
Save unique-EJ/8fa15761ec4370baa119acd679254192 to your computer and use it in GitHub Desktop.
Codecademy export
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| fun main() { | |
| var season = "!" | |
| // Write your code below | |
| when (season) { | |
| "Winter" -> println("Grow kale.") | |
| "Spring" -> println("Grow lettuce.") | |
| "Summer" -> println("Grow corn.") | |
| "Fall" -> println("Grow pumpkins.") | |
| else -> println("Not a valid season.") | |
| } | |
| /* ... | |
| My code: | |
| */ | |
| var a = "___. Not a valid season." | |
| when (season) { | |
| "Winter" -> a = "kale." | |
| "Spring" -> a = "lettuce." | |
| "Summer" -> a = "corn." | |
| "Fall" -> a = "pumpkins." | |
| } | |
| println("[Grow $a]") | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment