import keyword
print(keyword.kwlist)
[‘False’, ‘None’, ‘True’, ‘and’, ‘as’, ‘assert’, ‘async’, ‘await’, ‘break’, ‘class’, ‘continue’, ‘def’, ‘del’, ‘elif’, ‘else’, ‘except’, ‘finally’, ‘for’, ‘from’, ‘global’, ‘if’, ‘import’, ‘in’, ‘is’, ‘lambda’, ‘nonlocal’, ‘not’, ‘or’, ‘pass’, ‘raise’, ‘return’, ‘try’, ‘while’, ‘with’, ‘yield’]
intvar = 200
print(type(intvar)) #查看变量的类型
print(id(intvar)) #查看变量的地址
整型
浮点型(科学计数法)
布尔类型
复数类型
(Python的复数类型和C++的有很大区别,Python的可以直接写成复数)
表达方式一:
complexvar = 3 + 10j #直接写成复数
表达方式二
complexvar = complex(3,10) #complex函数