Nick Vitsinsky7,246 Points
Why do we remove " answer = gets.chomp" if we have to "return the answer passed in"?
I don't get why?
def parse_answer(answer, kind="string") answer = answer.to_i if kind == "number" return answer end
Steve HunterTreehouse Moderator 57,652 Points
In this case, the
answer is passed into the method. The value held by
answer may have been obtained by using
gets outside of this bit of code but, here, we don't need to ask the user for input as
answer already has a value.
Does that make sense?