+ 1
(SOLVED) whats wrong in this code? (Ruby)
puts "Welcome to the Driver License Test! Please enter your age.." age = gets.chomp if age < 18 puts "You are too young for driver license!" else puts "Here's your driver license sir!" end
2 Respuestas
+ 3
Use the `to_i` method to convert the input to integer to be able to compare it with 18. Change the line taking the input to
age = gets.chomp.to_i
+ 1
XXX a lot of thanks <3