728x90
반응형
How to append double quotes to a string and store as new string?
a = "Hello World"
# Beautiful usage in python
b = '"{}"'.format(a)
# in python 3.6 (or above)
b = f'"{a}"'
728x90
반응형
'Programming > Python' 카테고리의 다른 글
ModuleNotFoundError: No module named 'dotenv' (0) | 2024.08.22 |
---|---|
ModuleNotFoundError: No module named 'Crypto' (0) | 2024.08.22 |
[Python] TypeError: unsupported operand type(s) for |: 'type' and 'type' (0) | 2024.06.19 |
Python Error: externally-managed-environment (0) | 2024.05.28 |
[Python]fatal error: 'longintrepr.h' file not found (0) | 2024.05.24 |