Ex9 problem with q%

I have been trying to figure out why ex9 is not working, I’ve double, triple checked to see if it matches the text from the book and it does… any clue? I’m using Ruby version 2.3 if it matters

# Here's some new strange stuff, remember type it exactly.

days = "Mon Tue Wed Thu Fri Sat Sun"
months = "Jan\nFeb\nMar\nApr\nMay\nJun\nJul\nAug"

puts = "Here are the days: #{days}"
puts = "Here are the months: #{months}"

puts %q{
There's somethin ggoing on here.
With this weird quote
We'll be able to type as much as we like.
Even 4 lines if we want, or 5, or 6.


Check again. I see two typing errors inside the %q{}

Edited it…saw 2 errors…still doesn’t work.

You’re gonna kick yourself when you find out what it is. So in the future when you have a problem like this start deleting lines until the problem goes away. So if you delete all the lines before the %q then it works. That means it’s a problem with something you wrote above that. If you delete the first two lines of code then it works again. That means it’s those middle two lines. So why are you doing this:

puts =

doh! I will now bang my head against the keyboard 100 times as penance.

I noticed the puts = too afterwards :smile:

1 Like
A free service run by Zed A. Shaw for learncodethehardway.org.