1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57
| ''' 数据类型: Number: int 整数 float 小数,浮点数 String: 字符串, "hello", 'hello' Boolean: 布尔类型, True, False
List: 列表, [1,2,3] Tuple: 元组, (1,2,3) Dict: 字典, {"name": "蔡徐坤"} Set: 集合(了解), {1,2,3} Bytes: 二进制, b'hello'
None: 空值类型, None
'''
a = 10 print(type(a)) print(id(a))
a = 10.3 print(type(a))
b = "墨西哥发生了8.0级地震" print(type(b))
c = True print(type(c))
d = [1, 2, 3] print(type(d))
e = (1, 2, 3) print(type(e))
f = {"name": "渣渣辉", "age": 50} print(type(f))
g = {1, 2, 3} print(type(g))
h = b'hello' print(type(h))
i = None print(type(i))
|