Skip to content

Instantly share code, notes, and snippets.

@blammothyst
Created February 27, 2014 20:28
Show Gist options
  • Save blammothyst/9258862 to your computer and use it in GitHub Desktop.
Save blammothyst/9258862 to your computer and use it in GitHub Desktop.
Code from Learn Python the Hard Way(.org) ex 10
print "I am 6'2\" tall." #escape double-quote inside string
print 'I am 6\'2" tall.' #escape single-quote inside string
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
testing1 = "testing1"
testing2 = "testing2"
testing3 = "testing3"
testing4 = "testing4"
print "%r " % testing1
print "testing2"
print "%s " % testing3
print "testing4"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment