Getting user input freezes, not getting input


#1
user_input = gets.chomp

print user_input

When I run this code and type my input and press enter, it’s not getting input and the screen is freezing.
After some time SCT is getting printed on the screen and screen freezes again until I get an error message.

I went to the previous lesson, What you’ll be building, which I completed yesterday. I tried to run that code and typed my input and pressed enter. The same thing is happening, screen freezes and after some time SCT appears on screen and then I get an error message.

print "Thtring, pleathe!: "
user_input = gets.chomp
user_input.downcase!

if user_input.include? "s"
  user_input.gsub!(/s/, "th")
else
  puts "Nothing to do here!"
end
  
puts "Your string is: #{user_input}"


#2

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