Skip to content

Tag: string

How to include the symbol “{” in a Python format string?

How can I include { symbol in a string? My string I’m getting the error: I have escaped the { symbol and have tried without escaping too. I’m getting the same error in both cases. Answer Format strings contain “replacement fields” surrounded by curly braces {}. Anything that is not contained in br…

Python spacing and aligning strings

I am trying to add spacing to align text in between two strings vars without using ” ” to do so Trying to get the text to look like this, with the second column being aligned. Currently have it coded like this, just using spaces… I tried working with string.rjust & srting.ljust but to no…