标签:tuple pytho div 字符 ring 赋值 标准 变量 number
Python 中的变量不需要声明。每个变量在使用前都必须赋值,变量赋值以后该变量才会被创建。
在 Python 中,变量就是变量,它没有类型,我们所说的"类型"是变量所指的内存中对象的类型。
等号(=)用来给变量赋值。
等号(=)运算符左边是一个变量名,等号(=)运算符右边是存储在变量中的值。
Python3 中有六个标准的数据类型:
a = 1
b = 1
c = 1
a=b=c=1
a = 1
b = 1.1
c = 1j
d = True
a,b,c,d= 1,1.1,1j,True
print(type(a), type(b), type(c), type(d))
#运行后的结果为:<class ‘int‘> <class ‘float‘> <class ‘complex‘> <class ‘bool‘>
标签:tuple pytho div 字符 ring 赋值 标准 变量 number
原文地址:http://www.cnblogs.com/Amery313/p/7530825.html