Skip to content

Commit db2990b

Browse files
committed
Format
1 parent 7af16da commit db2990b

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

README.md

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

331331
### General Options
332-
```bash
332+
```python
333333
{<el>:<10} # '<el> '
334334
{<el>:>10} # ' <el>'
335335
{<el>:^10} # ' <el> '
@@ -339,22 +339,22 @@ Format
339339

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

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

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

357-
```bash
357+
```python
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-
```bash
366+
```python
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)