Home >Backend Development >Python Tutorial >How to type percent sign in python
The way to print the Python percent sign is to put "%" in the print statement and print it directly. The percent sign "%" can also be used to find the modulus, which is the result after dividing two numbers. Remainder, the percent sign "%" can also be used to format strings.
Python is a language designed to make complex tasks simple. The latest version of Python 3.7 has officially entered the beta release stage. The final version of Python 3.7 is scheduled to be released in June 2018, but no new features will be added to the Python 3.7 version after that. Today we will talk about % in python.
What are the uses of % in python?
1. Modulo operation. The so-called modulo operation is to calculate the remainder after dividing two numbers, and the symbol is %. For example, a % b is to calculate the remainder of a divided by b
2. String formatting method, such as
3. If you want to output % directly, you can
The above is the detailed content of How to type percent sign in python. For more information, please follow other related articles on the PHP Chinese website!