Commit d712c6dc by BellCodeEditor

save project

parent 81af85a6
Showing with 10 additions and 27 deletions
class Hero:
def __init__(self,name,hp,attack):
self.level = 1
self.name = name
self.hp= hp
self.attack= attack
def upgrade(self):
self.level=houyi.level+1
self.hp=houyi.hp+50
self.attack=houyi.attack+4
houyi = Hero("houyi",200,40)
houyi.upgrade()
print("hy",houyi.level)
print("now",houyi.hp)
print("jj",houyi.attack)
\ No newline at end of file
import turtle
pen=turtle.Pen()
pen.write("何当共剪西窗烛,\n更话巴山夜雨时。",font=("Times",20,"normal"))
pen.hideturtle()
turtle.done()
\ No newline at end of file
import turtle
pen=turtle.Pen()
pen.shape("turle")
pen.fillcolor("red")
pen.begin_fill()
for i in range(5)
pen.forward(200)
pen.right(144)
pen.end_fill()
turtle.done
\ No newline at end of file
pen.write("何当共剪西窗烛,\n更话巴山夜雨时。",font=("Times",20,"normal"))
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