Daffy duck lesson 7 help


print "what is your favorite sport"
user_input= gets.chomp.downcase!
if user_input.include? "s"
user_input.gsub!(/s/, "th")
else print "none"

my_string = "muchachos"
puts "adios, #(my_string)"

^^^here's my code.

it returns:

what is your favorite sport Baseball
adios, #(my_string)

what am I doing wrong?

thanks in advance.



Okay! First, you might need to show the user their transformed string using 'puts' instead of 'print' in the else block. Also, remove the exclamation mark here:


Hi jbeck19
use #{var_name} instead of #(var_name)

puts "adios, #{my_string}"


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