Commit e842fa60 by BellCodeEditor

save project

parent abf9421e
Showing with 159 additions and 26 deletions
import turtle as t
t.fillcolor("yellow")#脸
t.begin_fill()
t.circle(70)
t.end_fill()#脸 结束
t.penup()#耳朵1
t.goto(50,120)
t.pendown()
t.begin_fill()
t.circle(20,300)
t.penup()
t.forward(100)
t.left(90)
t.forward(100)
t.left(90)
t.end_fill()
t.goto(46,122)
t.setheading(15)
t.pendown()
t.fillcolor("pink")
t.begin_fill()
t.circle(11,260)
t.penup()
t.end_fill()
t.home()#耳朵2
t.right(180)
t.goto(-50,120)
t.pendown()
t.fillcolor("yellow")
t.begin_fill()
t.circle(-20,300)
t.end_fill()
t.penup()
t.home()
t.right(180)
t.goto(-46,122)
t.pendown()
for i in range(4):
t.forward(200)
t.left(90)
t.fillcolor("pink")
t.begin_fill()
t.circle(-11,280)
t.end_fill()
t.penup()
t.forward(100)
t.goto(-48,122)
t.penup()#头 结束
t.pensize(5)
t.goto(-10,130)#王
t.pendown()
t.setheading(0)
t.forward(20)
t.forward(-10)
t.right(90)
t.forward(10)
t.left(90)
t.forward(100)
t.forward(10)
t.forward(-20)
t.forward(10)
t.right(90)
t.forward(50)
t.forward(10)
t.left(90)
t.fillcolor("blue")
t.forward(10)
t.forward(-20)
t.forward(10)
t.penup()#王 结束
t.goto(35,70)#眼睛
t.pensize(10)
t.dot()
t.pensize(2)
t.pencolor("white")
t.goto(34,71)
t.dot()
t.pencolor("black")
t.goto(-35,70)
t.pensize(10)
t.dot()
t.pensize(2)
t.pencolor("white")
t.goto(-36,71)
t.dot()#眼睛 结束
# t.goto(-50,15)#线条
# t.pensize(5)
# t.pencolor("brown")
# t.forward(10)
# t.forward(-10)
# t.penup()
# t.goto(48,14)
# t.pendown()
# t.forward(7)
t.fillcolor("white")#嘴巴
t.begin_fill()
t.pencolor("black")
t.pensize(1)
t.goto(45,16)
t.setheading(105)
t.pendown()
t.begin_fill()
t.circle(45,150)
t.setheading(-39)
t.circle(70,90)
t.end_fill()
t.penup()
t.goto(-20,25)
t.setheading(-90)
t.pendown()
t.circle(10,180)
t.right(180)
t.circle(10,180)
t.penup()#嘴巴 结束
t.fillcolor("pink")#鼻子
t.begin_fill()
t.circle(50)
t.goto(-12,50)
t.pendown()
t.circle(-12)
t.end_fill()
t.hideturtle()
t.done()
\ No newline at end of file
a=6#长方形的长
b=3#长方形的宽
s=a*b#长方形的面积
print("长方形的面积为:"+str(s))#输出长方形的面积
\ No newline at end of file
class Hero:#设置一个英雄类
def __init__(self):#定义英雄属性
self.level=1
self.hp=300
self.attack=20
yase=Hero()
print(yase)
\ No newline at end of file
a=int(input("输入一个数字"))
list=[]
for i in range(1,a+1):
list.append(i)
print(list)
c=0
while True:
if len(list)==1:
break
else:
b=list[0]
list.pop(0)
c+=1
if c==3:
c=0
continue
else:
list.append(b)
print(list)
\ No newline at end of file
# 勇于挑战的创造师,下面的代码犯了两类典型错误,请你把bug揪出来吧。
area = ['盘丝洞','白骨洞','大雁塔']
monster = {'盘丝洞':'蜘蛛精','白骨洞': '白骨精','大雁塔':'花妖'}
# 打印出大雁塔
print(area[2])
# 向字典中添加 '地府':'僵尸'
monster['地府']='僵尸'
print(monster)
\ No newline at end of file
a=int(input("输入一个数"))
b=0
for i in range(1,a+1):
b+=i
print("一共发了"+str(b)+"个金币")
\ No newline at end of file
import turtle as t
t.penup()
t.forward(100)
t.left(90)
t.forward(100)
t.left(90)
t.pendown()
for i in range(4):
t.forward(200)
t.left(90)
t.penup()
t.forward(100)
t.left(90)
t.forward(100)
t.right(90)
t.forward(50)
t.left(90)
t.fillcolor("blue")
t.pendown()
t.begin_fill()
t.circle(50)
t.end_fill()
t.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