程序師世界是廣大編程愛好者互助、分享、學習的平台,程序師世界有你更精彩!
首頁
編程語言
C語言|JAVA編程
Python編程
網頁編程
ASP編程|PHP編程
JSP編程
數據庫知識
MYSQL數據庫|SqlServer數據庫
Oracle數據庫|DB2數據庫
您现在的位置: 程式師世界 >> 編程語言 >  >> 更多編程語言 >> Python

Python learning record - Operator 사

編輯:Python

Arithmetic operator

+

-

*

/ except

// Integers , Take business

% modulus , It's also a surplus , The remainder after division

** Index , Power operation

()

() higher than ** higher than * / // % higher than +-

Assignment operator

=, It can be a single variable , You can also assign values to multiple variables , such as a , b, v, d = 3,g = e = r = 17, You can also assign multiple variables at the same time

Compound assignment operator

+=、-=、*=、/=、//=、%=、**=

Compound with others , First calculate the... On the right of the compound assignment operator , Recalculate compound .

Comparison operator

==、!= 、>、<、>=、<=

Logical operators

and    Bull and : Both are true , It is true

or      Boor or : One is true is true
not      Buffy : There is only one operand , It's true , Just go back to the fake

Usually when writing , The part to judge whether it is true or false will be bracketed , It is more convenient to read programs

python Same as c, A non-zero number is false ,and Operator , There is one 0 Then for 0, Otherwise, return the last non 0 Numbers ;or Operator , All are 0 Only then 0, Otherwise, return the first non 0 Numbers .

end .


  1. 上一篇文章:
  2. 下一篇文章:
Copyright © 程式師世界 All Rights Reserved