https://github.com/jonathanmccormickjr/test-f-string-with-variable-and-value
https://github.com/jonathanmccormickjr/test-f-string-with-variable-and-value
Last synced: 4 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/jonathanmccormickjr/test-f-string-with-variable-and-value
- Owner: JonathanMcCormickJr
- Created: 2023-02-23T15:10:31.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-02-23T15:12:43.000Z (over 2 years ago)
- Last Synced: 2024-07-18T04:29:35.787Z (12 months ago)
- Language: Python
- Size: 1000 Bytes
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# test-f-string-with-variable-and-value
``` python
variable = 17print(f"{variable=}") # This is more space-efficient
print(f"variable={variable}")
```Output:
```
variable=17
variable=17
```Both print statements work, but one has a neat shortcut where we can insert the variable and the value it represents all at once.