03_python data types

python data types

The data type 1.python

(1) data type classification

python data types can be divided 数字型and 非数字型.

  • Numeric
    • Integer ( int)
    • Float float( )
    • Boolean bool( )
    • Complex type ( complex) (mainly used for scientific computing)
  • Non-digital type
    • String
    • List
    • Tuple
    • dictionary

Note: In Python 2.x, the integer value stored depending on the length of the further divided into: int(integer) long(long)

(2) variable between different types of operational problems:

  • 数字型变量Can be calculated directly between
  • 字符串变量Use between +string concatenation
  • 字符串变量And you can 整数use the *repetition of the same splicing字符串
  • 数字型变量And 字符串between not be another computing

    The definition and use of variables in 2.python

  • Defined: python is interpreted programming language, it does not specify a data type definition of variables. Interpreter type automatic recognition data according to the value to the right of the assignment operator.
  • Use: In Python, each variable must be assigned before use, variable assignment after the variable will be created

Note: Use the interactive differ on the form and interpretation of the definition and use of variables.

3.python variable named

  • case-sensitive identifier python
  • python named variables can be used:
    • Underline law
    • Small hump law
    • Large hump law

Guess you like

Origin www.cnblogs.com/lasnitch/p/11565084.html