4/17


#1

Hi,

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}"
else
puts "Ooo both variables are equal"
end

Link is here:
https://www.codecademy.com/courses/learn-ruby/lessons/control-flow-in-ruby/exercises/elsif?action=lesson_resume

and screen shot is here:


#2

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.


#3

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