Commit 836923d3 by BellCodeEditor

auto save

parent 5b7352d4
print("hello world!")
print("hello world!")
name = "悟空,"
name = "悟空,"
word = "你好!谢谢你的欢迎!以后我们一起学习python吧!"
print(name+word)
\ No newline at end of file
"""使用type查看数据类型"""
"""使用type查看数据类型"""
num = 9
float_num = 3.1415926
name = "悟空"
goods = ["雪碧", "可口可乐", "咖啡"]
print(type(num))
print(type(float_num))
print(type(name))
print(type(goods))
\ No newline at end of file
import turtle
import turtle
"""
1、导入turtle模块,
2、创建画笔,
3、将画笔设置成海龟的形状,
4、控制画笔向前移动200,
5、并让画布保存在界面
"""
pen=turtle.Pen()
pen.shape("turtle")
pen.forward(200)
turtle.done()
\ No newline at end of file
import turtle
import turtle
"""画出五角星"""
pen=turtle.Pen()
for i in range(5):
pen.forward(200)
pen.right(144)
pen.hideturtle()
turtle.done()
\ No newline at end of file
import turtle
import turtle
"""画出五角星,上色"""
pen=turtle.Pen()
pen.fillcolor("red")
pen.begin_fill()
for i in range(5):
pen.forward(200)
pen.right(144)
pen.end_fill()
pen.hideturtle()
turtle.done()
\ No newline at end of file
import turtle
import turtle
pen = turtle.Pen()
pen.fillcolor("red")
pen.begin_fill()
for i in range(36):
pen.forward(200) # 移动200
pen.left(170) # 改变方向
pen.end_fill()
pen.hideturtle()
turtle.done()
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment