Commit df33adaa by BellCodeEditor

save project

parent 7070371a
Showing with 63 additions and 8 deletions
......@@ -6,10 +6,12 @@ class Hero():
self.attack=attack
yase=Hero("垭瑟",300,20,1)
houyi=Hero("后羿",250,23,1)
print(yase.hp)
def Up_level():
yase.level=yase.level+1
yase.hp=yase.hp+50
yase.attack=yase.attack+4
Up_level()
print(yase.hp)
\ No newline at end of file
n=input("请输入要升级的人名:")
l=int(input("请输入要要升多少级:"))
print(int(n.hp))
def Up_level(i,up):
i.level=i.level+up
i.hp=i.hp+up*50
i.attack=i.attack+up*4
Up_level(n,l)
print(int(n.hp))
\ No newline at end of file
class Hero():
def __init__(self,name,hp,attack,level):
self.name=name
self.level=level
self.hp=hp
self.attack=attack
yase=Hero("垭瑟",300,20,1)
houyi=Hero("后羿",250,23,1)
print("垭瑟升级前攻击:",yase.attack)
print("垭瑟升级前血量:",yase.hp)
print("垭瑟升级前等级:",yase.level)
def Up_level(i,up):
i.level=i.level+up
i.hp=i.hp+up*50
i.attack=i.attack+up*4
Up_level(yase,1)
print("-"*50)
print("垭瑟升级后攻击:",yase.attack)
print("垭瑟升级后血量:",yase.hp)
print("垭瑟升级后等级:",yase.level)
\ No newline at end of file
import urllib.request
import urllib.parse
from json import loads
url = "https://gitblock.cn/WebApi/Users/" + input("请输入用户id:") + "/Get"
data = {"key":"value"}
data = urllib.parse.urlencode(data)
data = data.encode()
response = urllib.request.urlopen(url=url,data=data)
data = response.read()
print(loads(data.decode())["user"]["abstract"])
\ No newline at end of file
class Hero():
def __init__(self,name,hp,attack,level):
self.name=name
self.level=level
self.hp=hp
self.attack=attack
def Up_level(i,up):
i.level=i.level+up
i.hp=i.hp+up*50
i.attack=i.attack+up*4
yase=Hero("垭瑟",300,20,1)
houyi=Hero("后羿",250,23,1)
print("垭瑟升级前攻击:",yase.attack)
print("垭瑟升级前血量:",yase.hp)
print("垭瑟升级前等级:",yase.level)
Up_level(yase,1)
print("-"*50)
print("垭瑟升级后攻击:",yase.attack)
print("垭瑟升级后血量:",yase.hp)
print("垭瑟升级后等级:",yase.level)
\ 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