Sololearn: Learn to Code
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1
1. Use "age = gets.to_i". Whithout it, "age" is interpreted as a string, not an integer. 2. No human's age can be both less than 1 and greater than 5. Use "elsif x >= 1 && x <= 5". Same goes for your second elsif condition. 3. Answering your question, "elsif x >= 20 && x <= 25" does the job.
22nd Apr 2019, 7:36 PM
Diego
Diego - avatar