My .Capitalize isnt working


I have tried multiple different ways to get it to work and the .capitalize has only worked with one and the system told me i have to make it in another line instead of just adding it to the end of the line of text.

print "Whats Your First Name?"
first_name2 = first_name.capitalize

print "Whats Your Last Name?"
last_name2 = last_name.capitalize

print "What City Are You From?"
city2 = city.capitalize

print "What State Are You From? (please use abbreviations)"

puts "Your name is #{first_name}!"
puts "Your Last Name is #{last_name}!"
puts "You live in #{city}"
puts "You live in #{state}"


Did you mean to write, last_name = gets.chomp?


you might want to use

puts "You live in #{city2}"


yes. i fixed it and that is still not working


The instructions::
01. After each variable assignment: first_name, last_name, and city add the .capitalize! method
02. For state use the .upcase! method

You are asked to use .capitalize! with the exclamation marker
which indicates that variable itself , on which you perform the .capitalize method
So instead of for example
you using

city2 = city.capitalize

you could use


therewith changing the city variable itself is capitalized.

== discussions / opinions ==


Thank you very much. that fixed it.