Since Python 3.0, str.format and format support a percentage presentation type:

>>> f"{1/3:.0%}"
'33%'
>>> "{:.0%}".format(1/3)
'33%'
>>> format(1/3, ".0%")
'33%'

Percentage. Multiplies the number by 100 and displays in fixed ('f') format, followed by a percent sign.

The .0 part of the format spec .0% indicates that you want zero digits of precision after the decimal point, because with f"{1/3:%}" you would get the string '33.333333%'.

It works with integers, floats, and decimals. See PEP 3101.

Answer from miku on Stack Overflow
๐ŸŒ
Stack Abuse
stackabuse.com โ€บ python-string-interpolation-with-the-percent-operator
Python String Interpolation with the Percent (%) Operator
August 24, 2023 - Another description for it is simple positional formatting. The % operator tells the Python interpreter to format a string using a given set of variables, enclosed in a tuple, following the operator.
๐ŸŒ
Reddit
reddit.com โ€บ r/python โ€บ do you normally use string.format() or percentage (%) to format your python strings?
r/Python on Reddit: Do you normally use string.format() or percentage (%) to format your Python strings?
July 4, 2016 -

There are two ways of string formatting in python and I've been consistently using the percentage (%) method until now:

"Today is %s." % datetime.now() # 2018-06-03 16:50:35.226194
"%d is a good number." % 5 # 5

I know this may not be very eloquent, but does the job well. One of the major irritants for me is the number to string conversion, I've faced that error so many times in the earlier days when I simply used to "There are " + x + " mangoes.". This works great in most other languages as they "auto-convert" the x from integer to string, but not python because of its "explicitness". But today, I learned of this new method of string.format() which does the same job, perhaps more eloquently:

"Today is {0}.".format(datetime.now()) # 2018-06-03 16:50:35.226194 
"{0} is a good number.".format(5) # 5

The only problem I'd imagine would be when you have to deal with long floats:

f = 1.234535666
"this is a floating point number: {0}".format(f) # 1.234535666

Problem here is that it will output the entire float as it is without rounding, and here is where my percentage method has an edge!

"this is a floating point number: %.2f" % f # 1.23
๐ŸŒ
Powerfulpython
powerfulpython.com โ€บ blog โ€บ python-string-formatting
Python String Formatting
Prefer f-strings when working in a codebase that supports it - meaning, all developers and end-users of the code base are certain to have Python 3.6 or later. Until then, prefer str.format(). Exception: for the logging module, use percent-formatting, even if you're otherwise using f-strings.
๐ŸŒ
w3resource
w3resource.com โ€บ python-exercises โ€บ string โ€บ python-data-type-string-exercise-36.php
Python: Format a number with a percentage - w3resource
June 12, 2025 - Write a Python program to use the format() function to output a number in percentage format with specified precision.
๐ŸŒ
Medium
medium.com โ€บ @pivajr โ€บ pythonic-tips-how-to-format-percentage-values-in-python-bf9a5500d761
Pythonic Tips: How to Format Percentage Values in Python | by Dilermando Piva Junior | Medium
June 20, 2025 - Formatting it as 12.34% is the first step in transforming algorithms into insights. I hope this tip helps you display percentage values elegantly in your Python projects.
๐ŸŒ
GeeksforGeeks
geeksforgeeks.org โ€บ python โ€บ different-ways-to-escape-percent-in-python-strings
Different Ways to Escape percent (%) in Python strings - GeeksforGeeks
July 23, 2025 - We can use any of the listed method we like. But, f-strings is the best way to include variables and format string. Escaping the percent sign in Python strings is a straightforward task, but it's important to choose the method that best fits our use case. Whether we are using old-style string formatting, f-strings, or the format() method, there are several ways to achieve the desired output.
Find elsewhere
๐ŸŒ
Python
peps.python.org โ€บ pep-3101
PEP 3101 โ€“ Advanced String Formatting | peps.python.org
Multiplies the number by 100 and displays in fixed ('f') format, followed by a percent sign.
๐ŸŒ
Codefinity
codefinity.com โ€บ courses โ€บ v2 โ€บ 7baa9c39-994a-4cf7-893f-38de7f8d8b36 โ€บ 70a8ad35-4e0d-4341-8801-091da5644448 โ€บ 8e5f7342-9c7a-46d0-9203-a8a27a30356a
Learn Advanced Formatting: Float, Round, and Percent | Strings Formatting
[type] - type of number representing (e - scientific notation, % - percentage (will multiply number by 100), g - general format, f - fixed-point notation). You can dive deeper into possible options in Python documentation.
๐ŸŒ
Real Python
realpython.com โ€บ python-modulo-string-formatting
Modulo String Formatting in Python โ€“ Real Python
January 31, 2022 - As youโ€™ll see shortly, you can ... To insert a percent character (%) into the output, you can specify two consecutive percent characters (%%) in the format string....
๐ŸŒ
YouTube
youtube.com โ€บ shorts โ€บ W9tEM8rWpCk
Percent Formatting In Python | Python Tutorial - YouTube
Here's how to use percent formatting on Python strings!#coding #pythontutorial #pythonforbeginners #python #100daysofpython #pythontutorialforbeginners #codi...
Published ย  May 28, 2024
๐ŸŒ
Finxter
blog.finxter.com โ€บ home โ€บ learn python blog โ€บ how to print a percentage value in python?
How to Print a Percentage Value in Python? - Be on the Right Side of Change
May 31, 2022 - To print a percentage value in Python, use the str.format() method or an f-string on the format language pattern "{:.0%}". For example, the f-string f"{your_number:.0%}" will convert variable your_number to a percentage string with 0 digits precision. Simply run those three basic statements ...
๐ŸŒ
UC Berkeley Statistics
stat.berkeley.edu โ€บ ~spector โ€บ extension โ€บ python โ€บ notes โ€บ node42.html
Formatting Strings
In python, string formatting is performed through overloading of the percent operator (%) for string values. On the left hand side of the operator, you provide a string which is a combination of literal text and formatting codes. Each appearance of a formatting code is matched with an object ...
๐ŸŒ
Python Guides
pythonguides.com โ€บ percent-sign-mean-in-python
Percentage Symbol (%) In Python
November 6, 2024 - In Python, you can use the percent (%) operator to construct strings with a template string and variables containing your data. This is known as string interpolation. The % operator is a convenient way to format strings by substituting values into placeholders within the string.
๐ŸŒ
AskPython
askpython.com โ€บ home โ€บ how to print a percentage value in python?
How To Print A Percentage Value In Python? - AskPython
April 21, 2023 - In this example 3, we use f-string instead of the format function but the working is the same. The Number contains the value and the โ€˜:.0%โ€˜ syntax will help to convert an original value into a percentage value. Letโ€™s see the result. ... Here, letโ€™s print the percentage value using f-string in Python.
๐ŸŒ
TestMu AI Community
community.testmu.ai โ€บ ask a question
How can I print a percentage value in Python? - TestMu AI Community
December 23, 2024 - How can I print a percentage value in Python? Given a float between 0 and 1, how can I print it as a percentage? For example, 1/3 should print as 33%.
๐ŸŒ
Java2Blog
java2blog.com โ€บ home โ€บ python โ€บ print percentage sign in python
Print Percentage (%) Sign In Python? [3 Ways] - Java2Blog
November 26, 2023 - When using string formatting with the % operator, the percentage sign must be escaped by another percentage sign. ... In Python 2, you donโ€™t need parentheses for the print statement.
๐ŸŒ
IT Dojo
itdojo.com โ€บ home โ€บ python programming โ€บ using the percent sign inโ€ฆ
Using the Percent Sign in Python | IT Dojo
October 20, 2020 - In a string of text the โ€œ%โ€ finds a completely different use. Within a string it can be used for formatting. Normally characters enclosed in quotes (โ€ โ€œ) are treated literally, not as any type of code.
๐ŸŒ
sqlpey
sqlpey.com โ€บ python โ€บ python-print-literal-percent-in-string-format
Python String Formatting: How to Print a Literal Percent Sign Amidst Placeholders
November 4, 2025 - # Here, %% escapes the percent, and %s consumes the variable. output_tuple_format = "Print percent %% in sentence and not %s" % (test_data, ) print(output_tuple_format) # Output: Print percent % in sentence and not break. Since Python 2.6, the .format() method provides a more versatile approach.