diff --git a/README.md b/README.md index 6c9a47d..ab7fd55 100644 --- a/README.md +++ b/README.md @@ -185,6 +185,10 @@ re.search(, text) >>> person = {'name': 'Jean-Luc', 'height': 187.1} >>> '{p[height]:.0f}'.format(p=person) '187' +``` + +#### Or: +```python >>> f"{person['height']:.0f}" '187' ``` @@ -434,9 +438,7 @@ with open(filename, encoding='utf-8') as file: ### Write to File ```python with open(filename, 'w', encoding='utf-8') as file: - json.dump(, file) - # Or - file.write(json.dumps()) + json.dump(, file) # Or: file.write(json.dumps()) ``` SQLite