Ruby Ruby Loops Build a Simple Contact List Methods That Return a Value

Pls HELP

What is wrong here?

ask.rb
def parse_answer(answer, kind="string")
  answer = gets.chomp
  answer = answer.to_i if kind == "number"
  return answer
end

2 Answers

Hi Konstantinos,

Your codes look great except gets and chomp method in this line which should be delete because the challenge question didn't require this part.

  answer = gets.chomp

;)

Maciej Czuchnowski
Maciej Czuchnowski
36,427 Points

Why do you do gets.chomp with the answer variable? It is being passed in as an argument already. Just remove that line and it will work.