Ruby Tutorial - Object Method Parameters

  • + 1 comment
    # write your code here
    

    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 methodchomp' for nil:NilClass (NoMethodError) from solution.rb:27:in block in <main>' from solution.rb:25:ineach' from solution.rb:25:in `'