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
๐ŸŒ
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.
Discussions

Do you normally use string.format() or percentage (%) to format your Python strings?

Firstly, you can write e. g. {0:.2f} to specify a float with 2 decimals, see e. g. https://www.digitalocean.com/community/tutorials/how-to-use-string-formatters-in-python-3

Secondly, the best formatting method is f-strings, see e. g. https://www.blog.pythonlibrary.org/2018/03/13/python-3-an-intro-to-f-strings/

More on reddit.com
๐ŸŒ r/Python
130
75
June 28, 2016
Python string formatting with percent sign - Stack Overflow
I am trying to do exactly the following: >>> x = (1,2) >>> y = 'hello' >>> '%d,%d,%s' % (x[0], x[1], y) '1,2,hello' However, I have a long x, more than two items, so I t... More on stackoverflow.com
๐ŸŒ stackoverflow.com
python - f-string with percent and fixed decimals? - Stack Overflow
The google search python format percentage 2 decimal places returns 2 blogs and quite a few StackOverflow posts where this is solved. More on stackoverflow.com
๐ŸŒ stackoverflow.com
Python way of printing: with 'format' or percent form? - Stack Overflow
New documentation says this about the percent operator: "The formatting operations described here exhibit a variety of quirks that lead to a number of common errors ..." but it is not deprecated. docs.python.org/3/library/โ€ฆ More on stackoverflow.com
๐ŸŒ stackoverflow.com
๐ŸŒ
w3resource
w3resource.com โ€บ python-exercises โ€บ string โ€บ python-data-type-string-exercise-36.php
Python: Format a number with a percentage - w3resource
June 12, 2025 - Original Number: 0.25 Formatted Number with percentage: 25.00% Original Number: -0.25 Formatted Number with percentage: -25.00% ... Write a Python program to convert a decimal number into a percentage format with two decimal places.
๐ŸŒ
Learn Python
learnpython.org โ€บ en โ€บ String_Formatting
String Formatting - Learn Python - Free Interactive Python Tutorial
Any object which is not a string can be formatted using the %s operator as well. The string which returns from the "repr" method of that object is formatted as the string. For example: # This prints out: A list: [1, 2, 3] mylist = [1,2,3] print("A list: %s" % mylist)
๐ŸŒ
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.
๐ŸŒ
Python
peps.python.org โ€บ pep-3101
PEP 3101 โ€“ Advanced String Formatting | peps.python.org
Same as 'g' except switches to 'E' if the number gets to large. 'n' - Number. This is the same as 'g', except that it uses the current locale setting to insert the appropriate number separator characters. '%' - Percentage.
Find elsewhere
๐ŸŒ
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 ...
๐ŸŒ
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?
June 28, 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.
๐ŸŒ
sqlpey
sqlpey.com โ€บ python โ€บ top-7-ways-to-print-a-percentage-value-in-python
Top 7 Ways to Print a Percentage Value in Python - sqlpey
December 5, 2024 - For example, using :.2% will format the number with two decimal places. A: You can loop through the list and apply one of the formatting methods to each element, like so: values = [0.1, 0.5, 0.75] percentages = [f"{v:.0%}" for v in values] print(percentages) # Output: ['10%', '50%', '75%']
๐ŸŒ
PyFormat
pyformat.info
PyFormat: Using % and .format() for great good!
With this site we try to show you the most common use-cases covered by the old and new style string formatting API with practical examples. All examples on this page work out of the box with with Python 2.7, 3.2, 3.3, 3.4, and 3.5 without requiring any additional libraries.
๐ŸŒ
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 - # 1. Create a float or integer number: your_number = 0.42 # 2. Convert the number to a string value: percentage = "{:.0%}".format(your_number) # alternative for Python 3.6+: percentage = f"{your_number:.0%}" # 3.
๐ŸŒ
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.
๐ŸŒ
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 - Explore multiple methods in Python to print a literal '%' character when using string formatting operations like %, .format(), or f-strings, avoiding unintended variable substitution.
๐ŸŒ
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.
๐ŸŒ
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 ......