Sleddersquid

class robot

Jun 27th, 2019
120
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.32 KB | None | 0 0
  1. class Robot:
  2.     def __init__(self, name, color, weight):
  3.         self.name = name
  4.         self.color = color
  5.         self.weight = weight
  6.     def introduseSelf(self):
  7.         print("Hello, my name is ", self.name)
  8.  
  9. r1 = Robot("Tom",  "Red", 30)
  10. r2 = Robot("Jerry", "Bue", 40)
  11.  
  12. r1.introduseSelf()
  13. r2.introduseSelf()
Advertisement
Add Comment
Please, Sign In to add comment