Commit 99003c36 by BellCodeEditor

save project

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