**
Python第一天笔记
**
- Python的安装
找的安装项里面最小的 add那个→然后第二个自定义,然后开始傻瓜式安装法。 - 数的类型 number 数值 string 字符 list 列表 tuple元组类型 dict 字典类型 set 集合类型
- int 整形 还有Ture 是布尔型
- 0b表示二进制
- 0o表示八进制
- 十六进制:0-9(9之后的用A-F代表10-15)标识是0x
- 科学计数法 e2相当于10的平方
- 变量等于实数+虚数 var=3+2j
pycharm
新建是 project→new→pyfile
- 三引号中间可以换行(’’’ ‘’'或者 “”" “”")
- type 查看数据类型 例如
print(type(name)) age=4 print(type(age)) height = 1.85 print(type(height)) gender=True print(type(gender))
就如下图所示
3.课堂练习 求物品单价
price_src=input('请输入单价') weight_src=input('请输入重量') price=int(price_src) print(price) print(type(price)) weight=float (weight_src) print(type(weight)) money=price*weight print(money)