Browse Source

Format

pull/3/head
Jure Šorn 6 years ago
parent
commit
6c394b28a8
1 changed files with 4 additions and 7 deletions
  1. 11
      README.md

11
README.md

@ -261,13 +261,10 @@ import re
### Format ### Format
```python ```python
<str> = '{}, {}'.format(<el_1>, <el_2>) <str> = '{}, {}'.format(<el_1>, <el_2>)
```
#### Or:
```python
<str> = f'{<el_1>} {<el_2}'
<str> = f'{<el_1>}, {<el_2}'
``` ```
#### General:
#### General options:
```python ```python
{<el>:<10} # '<el> ' {<el>:<10} # '<el> '
{<el>:>10} # ' <el>' {<el>:>10} # ' <el>'
@ -276,13 +273,13 @@ import re
{<el>:^0} # '<el>' {<el>:^0} # '<el>'
``` ```
#### Specific for strings:
#### Options specific to strings:
```python ```python
{'abcde':.3} # 'abc' {'abcde':.3} # 'abc'
{'abcde':>10.3}' # ' abc' {'abcde':>10.3}' # ' abc'
``` ```
#### Specific for numbers:
#### Options specific to numbers:
```python ```python
{1.23456:.3f} # '1.235' {1.23456:.3f} # '1.235'
{1.23456:>10.3f} # ' 1.235' {1.23456:>10.3f} # ' 1.235'

Loading…
Cancel
Save