fork download
  1. # your code goes here
  2. class Robot:
  3. def __init__(self,name, color, weight):
  4. self.name = name
  5. self.color = color
  6. self.weight = weight
  7.  
  8. def self_introduce(self):
  9. print(f"hello my name is {self.name},"
  10. f" my eye colour is {self.color}"
  11. f"and my weight is {self.weight} ")
  12.  
  13.  
  14.  
  15. r1 = Robot("johh","Red", 40)
  16. r2 = Robot("murry","Blue", 45)
  17.  
  18. r1.self_introduce()
  19. r2.self_introduce()
Success #stdin #stdout 0.02s 9280KB
stdin
Standard input is empty
stdout
hello my name is johh, my eye colour is Redand my weight is 40 
hello my name is murry, my eye colour is Blueand my weight is 45