Learn Python the hard way, exercise 10.2:
tabby_cat = "\tI'm tabbed in."
persian_cat = "I'm split\non a line."
backslash_cat = "I'm \\ a \\ cat."
fat_cat = """
I'll do a list:
\t* Cat food
\t* Fishies
\t* Catnip\n\t* Grass
"""
print tabby_cat
print persian_cat
print backslash_cat
print fat_cat
2: Use '''
(triple-single-quote) instead. Can you see why you might use that instead of """
?
I can't see why I might use '''
instead of """
. It gives me the same output. Can someone explain me why I would use triple-single-quote instead of triple-double-quote? What's the difference between them?
"
and'
in python – Marcelmarcela'
instead of"
or vice-versa? Try applying the same logic. – Jedediah