Commit 99003c36 by BellCodeEditor

save project

parent 6507c607
Showing with 11 additions and 14 deletions
class hero: usernamwe = 'python'
def __init__(self,name,level,hp,attack): userpassword = '123456'
self.hp=hp while True:
self.level=level name = input("请输入用户名:")
self.attack=attack password = input("请输入密码:")
def aaa(self): if name == usernamwe and password == userpassword:
self.level=self.level+1 print("登录成功!")
self.hp=self.hp+50 break
self.attack=self.attack+5 print("重新输入")
tian=hero("tian",1,500,50) print("欢迎")
\ No newline at end of file
tian.aaa()
print(tian.hp)
\ 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