day004-python elementary data types and operators

First, the operator
1, arithmetic operators: two main objects for arithmetic computation (addition, subtraction operator and the like)
operator:

  +: Adding two objects
  : - to give a number to another number or a negative number by subtracting
  *: multiplying two numbers or returns the string to be repeated several times a
  /: x is divided by Y
  %: Returns the remainder of the division
  **: returns the power of y x
  @: returns the integer part's
2, comparison (relationship) operators: two objects for comparison (test for equality, greater than, etc. operator)
operator:

  ==: comparison equality
  =:! Compare two objects are not equal
  <>: Comparison of two objects are not equal
  >: Returns whether x is greater than Y
  <: Returns x is less than y. All comparison operators return 1 for true, 0 for false returns. True and False, respectively, which is equivalent to the special variables. Note the capitalization of these variable names.
  > =: Returns whether x is greater than equal to Y
  <=: Returns whether x is less than or equal Y

. 3, the assignment operator: means for assigning object values to the right of the operator (or calculated) assigned to the left of the operator.
Operator:

  =: Simple assignment operator
  + =: Addition assignment operator
  - =: subtraction assignment operator
  * =: multiplication assignment operator
  / =: division assignment operator
  % =: assignment modulo operator
  ** =: power assignment operation Fu
  @ =: assignment operator take divisible

4, logical operators: for a logic operation (AND-OR, etc.).
Operator:

  and: and the operator
  or: operator and
  not: the non-operator

5, bitwise operators: Python object according to the stored bit operation.
Operator:

  &: Bitwise AND operator: involved in computing two values, if the corresponding two bits are 1, the result of 1 bit, otherwise 0
  |: bitwise OR operator: as long as the two corresponding binary there is a 1, the result bit is set to 1.
  ^: Bitwise exclusive OR operator: When two different corresponding binary, the result is 1
  ~: bitwise operators: for each binary data bit inverse, i.e., the 1 to 0, the 0 becomes 1
  <<: left mobile operators: each binary operand to the left a number of bits of all, the number of bits of a mobile "<<" specifies the right, discarding the upper, lower 0s
  >>: right movement operator : the number of each binary operation ">>" several left all right, ">>" the number of bits specified by the right

6, members of the operator: determining whether an object contains another object.
Operator:

  in: 如果在指定的序列中找到值返回 True,否则返回 False
  not in: 如果在指定的序列中没有找到值返回 True,否则返回 False
7、身份运算符:判断是不是引用自一个对象
运算符:

  is: 判断两个标识符是不是引用自一个对象
  is not: is not是判断两个标识符是不是引用自不同对象

二、基本数据类型
待续更新。。。。

Guess you like

Origin www.cnblogs.com/june-L/p/11489071.html