Python语言程序设计(MOOC崇天)第二章学习笔记(python蟒蛇绘制+turtle库)

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 语法元素分析:

库引用,使用import保留字完成。或者 from  库名 import 函数名

使用import 库名 as 库别名 最好!

 

 

 

 

 

 

 

 

 

循环语句:

 

 

 range()函数

总结:

 

练习:

#drawsix
import turtle as t
t.pensize(2)
for i in range(6):
    t.fd(20)
    t.left(60)
t.done()

#TwoRoundDraw.py
import turtle as t
t.pensize(2)
for i in range(9):
    t.fd(150)
    t.left(80)  #720/9
t.done()

知识点:两者区别

    乌龟坐标 t.left(60)

    绝对坐标t.seth(60)

猜你喜欢

转载自blog.csdn.net/qq_37791134/article/details/83143083