Skip to content

Instantly share code, notes, and snippets.

@Chestermozhao
Created July 8, 2020 07:48
Show Gist options
  • Save Chestermozhao/d9b69f2300761658c9ba4b38d89cc71f to your computer and use it in GitHub Desktop.
Save Chestermozhao/d9b69f2300761658c9ba4b38d89cc71f to your computer and use it in GitHub Desktop.
class Pokemon(object):
def __init__(self, name, skill, level):
self.name = name
self.skill = skill
self.level = level
@property
def attack_power(self):
return self.level * 100
name = "Pikachu"
skill = "thunder"
level = 100
Pikachu = Pokemon(name, skill, level)
print(Pikachu.attack_power)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment