One of the primary differences between Ruby and Python is that Rubyists believe that there are many right ways to do anything and Pythonistas believe there is only one. Multiline comments and strings are a great example of this difference.
In ruby, multiline comments look like this:
And true to form, ruby provides several options for multiline strings.
1. Just add return characters in a string
2. Use a heredoc
EOS can be replaced with any string of characters. Whatever you use at the top must match what you use at the bottom.
3. Use the % operator
Pythonistas believe there should be only one correct way to do anything, so true to form, they have one way of doing all of these things. The triple quotation mark:
The only difference between multiline comments and multiline strings is that strings get used and comments don’t.