""" stay Python 3 in , There is only one integer type int, Expressed as a long integer , No, python2 Medium Long. stay Python2 There is no Boolean in , It uses numbers 0 Express False, use 1 Express True. To Python3 in , hold True and False Defined as a keyword , But their value is still 1 and 0, They can be added to numbers . """ """ Numeric type Python3 Support int、float、bool、complex( The plural ) perform python command , Create various digital objects , And print type """ a, b, c, d = 20, 5.5, True, 4+3j print(type(a), type(b), type(c), type(d))
Create and delete
# When you specify a value ,Number The object will be created a = 1 b = 2 # You can also use del Statement to delete some object references . del a, b
Numerical operation
# 1、 Division of values (/) Always return a floating point number , To get integer usage // The operator . # 2、 In mixed calculation ,Python Will convert integer to floating point . """ 5 + 4 # Add 4.3 - 2 # Subtraction 3 * 7 # Multiplication 2 / 4 # division , Get a floating point number 2 // 4 # division , Get an integer 17 % 3 # Remainder 2 ** 5 # chengfang """