Undefined local variable or method `first_name'


#1

Hi, would anyone shed some light on this? My code past, but got a comment said "undefined local variable or method `first_name' for #".

I checked but couldn't figure out what happened. Here's my code:

print "What's your first name?"
variable_first_name=gets.chomp.capitalize!

print "What's your last name?"
variable_last_name=gets.chomp.capitalize!

print "Which city are you from?"
variable_city=gets.chomp.capitalize!

print "Which state or province are you from?"
variable_state=gets.chomp.upcase!

puts "Your name is #{first_name} #{last_name} and you're from #{city}, #{state}!"

After ruuning it, it turned out like this:

Thanks for your help! :slightly_smiling:


#2

Hi try that one all your variable name

variable_first_name

Remote in the name of your variable

variable_

So just put It like that

first_name =

#3

It worked!! Thank you very much!!! :kissing_heart: