I want to use gets.chomp to find out age, and combine it with if to print out the basic "too young" or above 18, but I just get error when I try to run it. Anyone that gets what I'm missing? https://code.sololearn.com/cfEcU6l0JNns/?ref=app
10/24/2018 5:11:54 AM
Mattias Mjövik2 Answers
New AnswerConvert the input to integer with .to_i method on line 2 gets returns a string by default which fails "17" > 18 age = gets.chomp.to_i
Sololearn Inc.
535 Mission Street, Suite 1591Send us a message