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