Skip to content

Commit 7af16da

Browse files
committed
Format
1 parent f013a32 commit 7af16da

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

README.md

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -329,32 +329,32 @@ Format
329329
```
330330

331331
### 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>'
338338
```
339339

340340
### String Options
341341
**`'!r'` calls object's repr() method, instead of format(), to get a string.**
342-
```python
342+
```bash
343343
{'abcde'!r:<10} # "'abcde' "
344344
```
345345

346-
```python
346+
```bash
347347
{'abcde':.3} # 'abc'
348348
{'abcde':10.3} # 'abc '
349349
```
350350

351351
### Number Options
352-
```python
352+
```bash
353353
{1.23456:.3f} # '1.235'
354354
{1.23456:10.3f} # ' 1.235'
355355
```
356356

357-
```python
357+
```bash
358358
{ 123456:10,} # ' 123,456'
359359
{ 123456:10_} # ' 123_456'
360360
{ 123456:+10} # ' +123456'
@@ -363,7 +363,7 @@ Format
363363
{-123456: } # '-123456'
364364
```
365365
366-
```python
366+
```bash
367367
{65:c} # 'A'
368368
{3:08b} # '00000011' -> Binary with leading zeros.
369369
{3:0<8b} # '11000000' -> Binary with trailing zeros.

0 commit comments

Comments
 (0)