eahil

Failing Python Code

Jun 11th, 2013
77
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.76 KB | None | 0 0
  1. class Player:
  2.     '''A player class that includes health,
  3.    attack, defense, strength, and specials'''
  4.     def __init__(self, name, attack, defense, strength, hp = 100, special=None):
  5.         self.name = name
  6.         self.attack = attack
  7.         self.defense = defense
  8.         self.strength = strength
  9.         self.hp = self.hp
  10.         self.special = special
  11.  
  12.     def getStats(self):
  13.         return {
  14.                 'name': self.name,
  15.                 'hp': self.hp,
  16.                 'atk': self.attack,
  17.                 'def': self.defense,
  18.                 'str': self.strength,
  19.                 'special': self.special}
  20.  
  21.  
  22. def main():
  23.     player1 = Player('Samson',10,12,5,100)
  24.     print(player1.getStats())
  25.  
  26. if __name__ == "__main__":
  27.     main()
Advertisement
Add Comment
Please, Sign In to add comment