Skip to content

Instantly share code, notes, and snippets.

@adaptives
Created September 12, 2011 09:53
Show Gist options
  • Select an option

  • Save adaptives/1210943 to your computer and use it in GitHub Desktop.

Select an option

Save adaptives/1210943 to your computer and use it in GitHub Desktop.
LPTHW - Exercise 10
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
#use ''' instead of """
print '''
This is a multi-line
string using \'''
instead of """
'''
# let's combine escape sequences and format strings
book = 'Learn Python The Hard Way'
print "We will now go to a new line \nand print this book's name - %s" % book
#Let us use %r instead of %s
print "We will now go to a new line \nand print this book's name - %r" % book
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment