day1
Acquaintance Python
- View Python version
python --version
- Installation ipython- interactive programming tools
1、pip install ipython
2、pip install jupyter
3、jupyter notebook
- View python version information
import sys
print(sys.version_info)
print(sys.version)
- Draw a square
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()
Comments in the code
single-line comments - in the beginning of the space portion and #
multiline comment - marks the beginning of three, three closing quotes
- IPython - better interactive programming tools