day1
初识Python
- 查看Python版本
python --version
- ipython–交互式编程工具的安装
1、pip install ipython
2、pip install jupyter
3、jupyter notebook
- 查看python版本信息
import sys
print(sys.version_info)
print(sys.version)
- 绘制了一个正方形
import turtle
turtle.pensize(5)#画笔宽度
turtle.pencolor("red")#画笔颜色
turtle.forward(100)#前进100
turtle.right(90)#右转90度
turtle.forward(100)#前进100
turtle.right(90)#y右转90度
turtle.forward(100)#前进100
turtle.right(90)#右转90度
turtle.forward(100)#前进100
turtle.mainloop()
代码中的注释
单行注释 - 以#和空格开头的部分
多行注释 - 三个引号开头,三个引号结尾
- IPython - 更好的交互式编程工具