Make up: Day 6 python learning data compilation

Basic data types:

1, numeral (int)

python3 in: All numbers are int. n = 1123456789

python2 in: less of the median time to call int, n = 12345 digits long called long, n = 1234567890

 

View all int function (magic): Similarly str list tuple dict bool

Input int In pycharm inside - "Re-click elsewhere -" the keyboard ctrl click int-- "all the magic out int

 int-- converted into a digital string, numeric strings which need be 

= a "123" 

Print (type (a)) # - Output a type

b = int (a)

b = b + 1000

Print (type (b)) # - type of output b

 

 

= num "A" 
V = int (num, base = 16) # - indicates convert to hexadecimal num default indicates no base is converted to decimal
print (v)

 bit_lenght——

 

2, a string (str)

3, the list (list)

4, the tuple (tuple)

5. dictionary (dict)

6, Boolean (bool)

Guess you like

Origin www.cnblogs.com/jianchixuexu/p/11432164.html