Commit 66b544ef by BellCodeEditor

auto save

parent 6b1fbc15
Showing with 106 additions and 2 deletions
import wordcloud
\ No newline at end of file
class Hero:
def __init__(self,name,hp,attack):
self.level=1
self.hp=250
self.attack=40
self.name=name
def combat(self,enemy)
info1 = self.name+"对"+enemy.name+进攻
info2 = "造成"+str(self.attack+)
def upgrade():
yase.level=yase.level+1
yase.hp=yase.hp+50
yase.attack=yase.attack+4
yase=Hero("亚瑟",300,20)
print("血量:",yase.hp)
upgrade()
upgrade()
print("血量:",yase.hp)
myloud.png

73.3 KB

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