Where do I input my answers?


Would anyone be able to tell me where I am supposed to input my answer before I run the code? For example, where should I type my first name? Thanks in advance for your help!

print "What’s your first name? "
first_name = gets.chomp

print "What’s your last name? "
last_name = gets.chomp

print "What city are you from? "
city = gets.chomp

print "What state or province are you from? "
state = gets.chomp

puts “Your name is #{first_name} #{last_name} and you’re from #{city}, #{state}!”


you shouldn’t? Run the code/program, while the program is running gets.chomp will prompt you for input

  1. Run the code.
  2. Computer will ask you for the input
  3. input


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