语法:变量名 = 值
= : 赋值
命名习惯大驼峰:MyName
小驼峰:myName
下划线:my_name
注意事项1.严格区分大小写
2.由字母,数字,下划线组成
3.不能以数字开头
数据类型数据类型可分为整形,布尔型,字符串型,列表型,集合型,字典型........
在日常中我们最常用到的数据类型有:整形(Int),布尔型(Boool),字符串型(Str),其实数据类型还有很多:set -- 集合,tuple -- 元组,list -- 列表,dict -- 字典
# -- Int --整型
a0 = 84
print(type(a0))
# -- float -- 双精度型
a2 = 3.23
print(type(a2))
# -- bool -- 布尔型 (用于判断时使用)
b = True
print(type(b))
# -- Str -- 字符串型
c = 'hello python'
print(type(c))
# -- set -- 集合
d = { 10,20,30}
print(type(d))
-- tuple -- 元组
e = (10,20,30)
print(type(e))
# -- list -- 列表
f = [10,20,30]
print(type(f))
# -- dict -- 字典
g = {'NAME' : '张三' , 'age' : '18'}
print(type(g))


![[Python开发]数据类型及变量 [Python开发]数据类型及变量](http://www.mshxw.com/aiimages/31/942514.png)
