Won't let me continue although I did what they asked, just in a different way


It asked me to add in the capitalization like this:
print "This is my question?"
answer = gets.chomp
answer2 = answer.capitalize

I got it to do the same thing by doing this:
print "What's your first name?"
first_name = gets.chomp.capitalize
print "What's your last name?"
last_name = gets.chomp.capitalize
print "What city do you live in?"
city = gets.chomp.capitalize
print "What state or province do you live in?"
state = gets.chomp.upcase
puts "Your name is #{first_name} #{last_name} and you live in #{city}, #{state}!"

The output of my coding was this:
What's your first name? annonymous
What's your last name? annonymous
What city do you live in? annonymous
What state or province do you live in? EX
Your name is Annonymous Annonymous and you live in Annonymous, EX!

It won't let me continue on with lessons and tells me this every time:
Oops, try again. Make sure to call capitalize! on first_name, last_name, and city.


I did what they asked, but it forced you to type something twice for each question.
I got past it anyway, but I'm still confused to why it didn't accept my coding.


Try that code over here: https://repl.it/languages/ruby

Experiment with different answers. Try with names that have their first letter uppercase and names that do not.

What did you find out?