1. """
    2. 1. 按经验将不同的变量存储不同的类型的数据
    3. 2. 验证这些数据到底是什么类型--检测数据类型--type(数据)
    4. """
    5. # int -- 整型
    6. num1 = 1
    7. # float -- 浮点型,即小数
    8. num2 = 1.1
    9. print(type(num1))
    10. print(type(num2))
    11. # str -- 字符串. 特点:数据都要带引号
    12. a = 'melexis is a great IC company'
    13. print(type(a))
    14. # bool -- 布尔型,通常判断的时候使用,布尔型有两个取值 True 和 False
    15. b = True
    16. print(type(b))
    17. # list -- 列表
    18. c = [10, 20, 30]
    19. print(type(c))
    20. # tuple -- 元组
    21. d = (10, 20, 30)
    22. print(type(d))
    23. # set --集合
    24. e = {10, 20, 30}
    25. print(type(e))
    26. # dict -- 字典-- 键值对
    27. f = {'name': 'tom', 'age': 20}
    28. print(type(f))