Skip to content
  • P
    Projects
  • G
    Groups
  • S
    Snippets
  • Help

bellcode / lesson13-4

  • This project
    • Loading...
  • Sign in
Go to a project
  • Project
  • Repository
  • Issues 0
  • Merge Requests 0
  • Pipelines
  • Wiki
  • Snippets
  • Members
  • Activity
  • Graph
  • Charts
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
  • Files
  • Commits
  • Branches
  • Tags
  • Contributors
  • Graph
  • Compare
  • Charts
Commit 294eb441 authored 3 years ago by BellCodeEditor's avatar BellCodeEditor
Browse files
Options
  • Browse Files
  • Download
  • Email Patches
  • Plain Diff

save project

parent adc52e7f
Hide whitespace changes
Inline Side-by-side
Showing with 10 additions and 8 deletions
  • hero.py
hero.py
View file @ 294eb441
class Hero: class Hero:
def __init__(self): def __init__(self,hp,attack,speed):
self.level = 1 self.hp = hp
self.hp= 300 self.attack = attack
self.attack= 20 self.speed = speed
yase=Hero() yase=Hero(300,20,1.5)
sangqi=Hero(200,20,2)
kai=Hero(250,100,1.8)
print("亚瑟的血量为",yase.hp) print("亚瑟的血量为",yase.hp)
print("亚瑟的等级为",yase.level) print("凯的攻击力为",kai.attack)
print("亚瑟的攻击力为",yase.attack) print("桑启")
\ No newline at end of file \ No newline at end of file
This diff is collapsed. Click to expand it.
  • Write
  • Preview
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