File tree Expand file tree Collapse file tree 1 file changed +11
-11
lines changed Expand file tree Collapse file tree 1 file changed +11
-11
lines changed Original file line number Diff line number Diff line change @@ -329,32 +329,32 @@ Format
329
329
```
330
330
331
331
### General Options
332
- ``` python
333
- ' {<el>:<10}' # '<el> '
334
- ' {<el>:>10}' # ' <el>'
335
- ' {<el>:^10}' # ' <el> '
336
- ' {<el>:->10}' # '------<el>'
337
- ' {<el>:>0}' # '<el>'
332
+ ``` bash
333
+ {< el> :< 10} # '<el> '
334
+ {< el> :> 10} # ' <el>'
335
+ {< el> :^10} # ' <el> '
336
+ {< el> :-> 10} # '------<el>'
337
+ {< el> :> 0} # '<el>'
338
338
```
339
339
340
340
### String Options
341
341
** ` '!r' ` calls object's repr() method, instead of format(), to get a string.**
342
- ``` python
342
+ ``` bash
343
343
{' abcde' ! r:< 10} # "'abcde' "
344
344
```
345
345
346
- ``` python
346
+ ``` bash
347
347
{' abcde' :.3} # 'abc'
348
348
{' abcde' :10.3} # 'abc '
349
349
```
350
350
351
351
### Number Options
352
- ``` python
352
+ ``` bash
353
353
{1.23456:.3f} # '1.235'
354
354
{1.23456:10.3f} # ' 1.235'
355
355
```
356
356
357
- ``` python
357
+ ``` bash
358
358
{ 123456:10,} # ' 123,456'
359
359
{ 123456:10_} # ' 123_456'
360
360
{ 123456:+10} # ' +123456'
@@ -363,7 +363,7 @@ Format
363
363
{-123456: } # '-123456'
364
364
` ` `
365
365
366
- ``` python
366
+ ` ` ` bash
367
367
{65:c} # 'A'
368
368
{3:08b} # '00000011' -> Binary with leading zeros.
369
369
{3:0< 8b} # '11000000' -> Binary with trailing zeros.
You can’t perform that action at this time.
0 commit comments