We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
for loop in 1..iter
line = gets.chomp().split(" ")
a = line[0].to_i
b = line[1].to_i
c = line[2].to_i
puts range(a,b,c)
end
**The above code gives error online which is pretty weird
**
solution.rb:1: warning: constant ::Fixnum is deprecated
solution.rb:13:in range_call': undefined methodchomp' for nil:NilClass (NoMethodError)
from solution.rb:27:in block in <main>'
from solution.rb:25:ineach'
from solution.rb:25:in `'
Ruby Tutorial - Object Method Parameters
You are viewing a single comment's thread. Return to all comments →
def range(a,b,c) return (b..c).include?a end
iter = gets().chomp() iter = iter.to_i
for loop in 1..iter line = gets.chomp().split(" ") a = line[0].to_i b = line[1].to_i c = line[2].to_i puts range(a,b,c) end
**The above code gives error online which is pretty weird ** solution.rb:1: warning: constant ::Fixnum is deprecated solution.rb:13:in
range_call': undefined method
chomp' for nil:NilClass (NoMethodError) from solution.rb:27:inblock in <main>' from solution.rb:25:in
each' from solution.rb:25:in `'