print "Need a dispenser-, err I need some input here!" user_input = gets.chomp user_input.downcase! print "You got an S there, son." if user_input.gsub!(/s/, "th") else print "A spy's sappin' my sentry! And he doesn't have an S!" end
So, yeah. Hi there. I've been having problems with creating the Else branch. It keeps coming up with :
(ruby):6: syntax error, unexpected keyword_else, expecting $end
else print "A spy's sappin' my sentry! And he doesn't have an S!"
^ : every time I try to submit it. And I have tried other variations of this and looked on the other threads for guidance, and my code SEEMS to be fine. Like, am I missing something? Did I delete something without knowing? What's going on here? Please help?