Advertisement
dd97

tank_info_class

Apr 1st, 2016
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.33 KB | None | 0 0
  1. #!/usr/bin/python
  2.  
  3. class Tank:
  4.     def __init__(self, tank_id, name, level):
  5.         self.tank_id = tank_id
  6.         self.name = name
  7.         self.level = level
  8.  
  9.     def tank_info(self):
  10.             print "Tank ID: {}, Tank Name: {}, Tank Level: {} ".format(self.tank_id, self.name, self.level)
  11.  
  12.  
  13. patton = Tank(2, 'patton', 3)
  14. patton.tank_info()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement