Commit 8fcfc77e by BellCodeEditor

save project

parent c1f013fc
Showing with 8 additions and 4 deletions
class Bird:
def __init__(self,name,hp,attack):
self.level=1
self.name=name
self.hp=hp
self.attack=attack
redbird=Bird("红色小鸟",500,50)
bluebird=Bird("蓝色小鸟",450,55)
print("红色小鸟的血量为:",redbird.hp)
print("蓝色小鸟的血量为:",bluebird.hp)
\ No newline at end of file
def upgrade():
redbird.level=redbird.level+1
redbird.hp=redbird.hp+10
redbird.attack=redbird.attack+5
upgrade()
\ 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