Skip to content

Escape percentage symbol (%) in Strings

Python uses the % symbol in strings as variable placeholder, so you need to escape it. You might expect it to be \%, but actually it’s %%.


Be First to Comment

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.