Christopher Kemp3,446 Points
When I try to run this, all I get is the "Bummer: Try again!" message and so I am not even sure where I am going wrong because i can't preview what the code is doing either.
def parse_answer(answer, kind="string") answer = gets.chomp if kind == "number" answer = answer.to_i end puts answer end
William LiPro Student 26,790 Points
Couple issues with your code.
answer was pass-in as the method argument, you do NOT need to assign
putsstatement doesn't generate any return value for the method.
def parse_answer(answer, kind="string") if kind=='number' answer = answer.to_i end answer end
this should do it.