Formatage de chaînes Flashcards

1
Q

%f

A

Nombre décimal avec six chiffres après la virgule

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

%s

A

Chaîne de caractères

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

%d

A

Nombre décimal (en base 10)

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

%r

A

Chaîne de caractères brute, telle que Python la “voit”

Utilise repr(), pas (str()

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

%i

A

Nombre entier

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

%c

A

Caractère unique (int ou str)

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

%%

A

Le caractère ‘%’

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