String Escape Sequences Flashcards
'
put a single quote mark in a string (‘)
print” he's clever!”
he’s clever
"
allows double quote marks in string (“)
print “"your so silly" he said.”
“your so silly” he said.
\a
sounds an audio beep
ASCII bell (BEL)
\b
ASCII backspace (BS)
print “every \bday”
everyday
\f
ASCII formfeed (FF) indent new line print "every \fday
every
day
\n
ASCII linefeed
new line
print “every /nday”
every
day
\N{name}
returns character named name from unicode database (unicode only)
\r
carriage return (CR) in ASCII starts at beginning of line again can overwrite
print”every bloody \rday
dayry bloody
\t
horizontal tab (TAB) in ASCII indent (tab) forwards
print “every bloody \tday”
every bloody day
\uxxxx
returns character with 16-bit hex value xxxx (unicode only)
\uxxxxxxxx
returns character with 32-bit hex value xxxxxxxx (unicode only
\v
ASCII vertical tab
return new line at end point of previous line
print “every bloody \vday”
every bloody
day
\ooo
returns character with octal value ooo
\xhh
returns character with hex value hh
what does the raw_input function do?
enables user to input text
enables program to get data and data types from a user
enable program to use this data in program
enable program to print a string of data to user based on that input