This is Omair Hassan Khan. I am again stuck within the code. It seem that if I write gets.chomp statement then it caused some internal error. Here is my code:

x = Integer(gets.chomp)
y = Integer(gets.chomp)

if x > y
puts "Hey #{x} is greater #{y}"
elsif x < y
puts "Hey #{x} is less than #{y}"
puts "Ooo both variables are equal"

Link is here:

and screen shot is here:


Eh, no such error when I run it. Where’s your user input? Your screenshot cuts out part of the error message, I imagine it says which value isn’t a valid integer. If you weren’t entering any input at all, then perhaps reloading the page helps fix the environment.


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.