Keeps asking me to set a variable for my "city", can anyone help? "putting the form in formatting"


#1

print "what is your last name?"
last_name=fleming=gets.chomp

print "what city are you from?"
variable_city=fitchburg=gets.chomp

print "what state are you from?"
variable_state=massachusetts=gets.chomp.upcase

I also wrote this code this way as well.

print "what is your last name"
last_name=gets.chomp

print "what city are you from"
variable_city=gets.chomp

print "what state are you from"
variable_state=gets.chomp.upcase


#2

last_name=fleming <-- here you have assigned your city name to variable. gets.chomp is method to get input from user, so you should try like this: last_name = gets.chomp. In that way every user can input their own city name


#3

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.