Python 3.7.8 [tags/v3.7.8:4b47a5b6ba, MSC v.1916 64 bit (AMD64)]
Windows-10
IDE:VS2019社区版本 //傻瓜安装即可,自动配置python环境,学习先专注代码
用VS创建项目-创建.py文件,写入
print('Hello world!')
F5调试直接输出Hello world!
Hello world!
python 基本数据类型
- 数学(num)
- int(带符号整数)
- long(python3已经删除)
- float(浮点型)
- complex(复数)
- bool(真假)
- 字符串
- 字典
- 元组
- 列表
变量命名规则:大小写敏感,不能用数字开头;可用数字;字符;下划线;不能用python关键字
变量命名测试,type语法显示变量类型
a=10
print(type(a))
b="哈哈"
print(type(b))
c=10.67
print(type(c))
e={}
print(type(e))
f=[]
print(type(f))
g=()
print(type(g))
h=True
print(type(h))
F5运行
<class 'int'>
<class 'str'>
<class 'float'>
<class 'dict'>
<class 'list'>
<class 'tuple'>
<class 'bool'>