String Escape Sequences Flashcards

0
Q

'

A

put a single quote mark in a string (‘)

print” he's clever!”

he’s clever

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
1
Q

\

A

to put a blackslash in a string ()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

"

A

allows double quote marks in string (“)

print “"your so silly" he said.”

“your so silly” he said.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

\a

A

sounds an audio beep

ASCII bell (BEL)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

\b

A

ASCII backspace (BS)

print “every \bday”

everyday

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

\f

A
ASCII formfeed (FF) 
indent new line
print "every \fday

every
day

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

\n

A

ASCII linefeed
new line

print “every /nday”
every
day

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

\N{name}

A

returns character named name from unicode database (unicode only)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

\r

A
carriage return (CR) in ASCII
starts at beginning of line again can overwrite

print”every bloody \rday

dayry bloody

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

\t

A
horizontal tab (TAB) in ASCII
indent (tab) forwards

print “every bloody \tday”

every bloody day

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

\uxxxx

A

returns character with 16-bit hex value xxxx (unicode only)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

\uxxxxxxxx

A

returns character with 32-bit hex value xxxxxxxx (unicode only

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

\v

A

ASCII vertical tab
return new line at end point of previous line

print “every bloody \vday”
every bloody
day

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

\ooo

A

returns character with octal value ooo

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

\xhh

A

returns character with hex value hh

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

what does the raw_input function do?

A

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