Created
September 12, 2011 09:53
-
-
Save adaptives/1210943 to your computer and use it in GitHub Desktop.
LPTHW - Exercise 10
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #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