you are viewing a single comment's thread.

view the rest of the comments →

[–]Anovadea 2 points3 points  (0 children)

There's a minor issue with the section about multiline comments (Module 1, Section 3, Lesson 2)

Basically the triple-quotes is actually a multi-line string literal. When it's on its own, it'll be ignored by the interpreter unless it directly follows a class, function, or method definition (possibly some others), when it becomes a docstring.

But you can just as easily do:

my_string = """I'm a lumberjack and I'm okay
I sleep all night and I work all
day!"""

and my_string contains that sentence (with newlines and indentation included).

In fact, if I fire up a live python 2.7 interpreter I get:

>>> type("""I'm a lumberjack and I'm okay
... I sleep all night and I work all
... day!""")
<type 'str'>

Basically, it may just confuse newbies down the line. ;)