Advertisement
Guest User

Untitled

a guest
May 21st, 2018
66
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.38 KB | None | 0 0
  1. class Lion:
  2.   def __init__(self, x, y):
  3.     self.x = x
  4.     self.y = y
  5.     print("Arrr " + str(x) + " " + " " + str(y))
  6.  
  7. class Dog:
  8.   def __init__(self, x, y):
  9.     self.x = x
  10.     self.y = y
  11.     print("Woof " + str(x) + " " + " " + str(y))
  12.  
  13. def createAnimals(animalClass, count):
  14.   for i in range(count):
  15.     animalClass(5, 4)
  16.  
  17. createAnimals(Lion, 8)
  18. createAnimals(Dog, 5)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement