String format not actually formating?


#1



https://www.codecademy.com/en/courses/ruby-beginner-en-MxXx5/0/5?curriculum_id=5059f8619189a5000201fbcb


it doesn't format the variables, just the string #{first_name} etc


Replace this line with your code. 
print "What's your first name?"
first_name = gets.chomp
print "What's your last name?"
last_name = gets.chomp
print "What's your city?"
city = gets.chomp
print "What's your state?"
state = gets.chomp
puts 'yo #{first_name} #{last_name} #{city} #{state}!'


#2

Ruby requires double quotes when interpolating string

replace
puts 'yo #{first_name} #{last_name} #{city} #{state}!'
with
puts "yo #{first_name} #{last_name} #{city} #{state}!"

viola


#3

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