Old Style String Formats Flashcards

(16 cards)

1
Q

%d

A

Decimal Integers (not floating points)

“%d” %15 == “15”

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

%i

A

same as %d

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

%o

A

Octal number

“%o” %1000 == ‘1750”

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

%u

A

Unsigned Decimal

“%u% %-1000 == ‘-1000’

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

%x

A

Hexadecimal Lowercase

“%x” %1000 == ‘3e8’

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

%X

A

Hexadecimal Uppercase

“%x” %1000 == ‘3E8’

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

%e

A

Exponential notation, lowercase e

“%e” %1000 == ‘1.000000 + 03”

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

%E

A

Exponential notation, uppercase e

“%e” %1000 == ‘1.0000

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

%f

A

Floating point real number

“%f” %10.34 == ‘10.34000’

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

%F

A

Floating point real number

“%f” %10.34 == ‘10.34000’

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

%g

A

Either %f or %e, whichever is shorter

“%g” %10.34 == “10.34”

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

%G

A

Either %f or %e, whichever is shorter

“%g” %10.34 == “10.34”

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

%c

A

Character Format

“%c” %34 == ‘ “ ‘

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

%r

A

Repr format(debugging format)

“%r” %int == “”

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

%s

A

String Format

“%s there” %”hi” == “hi there”

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

%%

A

A percent sign

“%g%%” %10.34 == ‘10.34%’