Commit 31c430e7 by BellCodeEditor

save project

parent 53906414
Showing with 10 additions and 10 deletions
class Hero: import turtle
def __init__(self,name,hp,attack): pen=turtle.Pen()
self.name=name pen.color("black","red")
self.hp=hp pen.begin_fill()
self.attack=attack for i in range(4):
yase=Hero('亚瑟',300,20) pen.forward(100)
a=Hero('后羿',250,23) pen.left(90)
print(yase.hp) pen.end_fill()
print(a.hp) pen.hideturtle()
\ No newline at end of file \ 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