The following code:
a = 0
b = f'{"c": {a}}'
throws the error: ValueError: Sign not allowed in string format specifier
How to fix it?
Escape the braces like this.
>>> f'{{"c": {a}}}'
'{"c": 0}'
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With