Sort 18 Discussions, By:
Please Login in order to post a comment
The name of the method 'odd_or_even' is confusing...
Should be 'even?' or 'is_even?'
I found weird that, given the following inputs:
we got the following results:
Could someone explain me why is this happening? Is the order of the results/outputs wrong?
Because the first number indicates the number of test cases or numbers that will be tested. The results show the evaluation for numbers after 5.
I also got confused at that! They should mention that in the problem description.
Yes, it would be nice to see what is going on under the hood. Is some Ruby program running to grab the inputs (i.e., using gets or something)?
why is it printing a 5 first?
5 is how many numbers have been input - maybe the code prints this out first
the decription is a bit confusing but the code is fairly simple
I have learned about IT in the university for 3 years. but i can't resolve anything in this website even I see discussions forum. How useless my 3 years are!
I really don't know what code to write for this, I just started learning ruby last week? can anyone pls help, how I should start this code?
Why '6.even?' is considered as wrong answer and 'number.even?' was considered as right answer ?
help , ruby-tutorial-object-methods .
whats the code ?
Check the hint!
n = gets.chomp.to_i n.times do a = gets.to_i if a.even? puts false else puts true end end
result wat i got is true true false false 4
please can anyone suggest