What is the operation symbol of [//] in python?

王林
Release: 2020-10-20 14:15:30
Original
70196 people have browsed it

[//] in python is an arithmetic operation symbol, indicating integer division. It will return the integer part of the result, such as [print(7//2)], and the output result is 3. The arithmetic operation symbols in Python include [ ], [-], [*], [%], etc.

What is the operation symbol of [//] in python?

//Operator means downward division, it will return the integer part of the integer division result

(Recommended tutorial: python Video tutorial)

print(7//2)
#3
Copy after login

Here, after integer division, it will return 3.5

Similarly, when performing the exponentiation operation, ab will return a raised to the power b

print(2**10)
#1024
Copy after login

Finally, %Performs the modulo operation and returns the remainder of the division

print(13%7)#6
print(3.5%1.5)#0.5
Copy after login

Related recommendations:python tutorial

The above is the detailed content of What is the operation symbol of [//] in python?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!