Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What operators are available in python and how to use them

2025-04-03 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly explains what operators python has and how to use them. Interested friends may wish to have a look at them. The method introduced in this paper is simple, fast and practical. Let's let the editor learn what operators python has and how to use it.

I. arithmetic operation

1, +, -, *, /, addition, subtraction, multiplication, division, the four most basic operators.

2.%, modular, is to take the remainder of one number divided by another, such as 8% 3, is to find the remainder of 8 divided by 3, and the result is 2.

3, * *, take a power, such as 2 to the third power of 2.

4, / /, take the integral division, that is, take the integer part of the quotient and discard the fraction part, for example, the value of 7 prime prime 3 is 2pm 5 and the value of prime 3 is 1.

II. Comparison operation

1, = =, equal to, consists of two =, and one = is assigned a value to a variable. = = means that both sides are equal.

2! =, does not mean that, by a! And a =, which is not equal to can be in python2 (consisting of a pair of angle brackets).

3.

< 、>

=,

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report