Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class cow(object):
- def __init__(self):
- self.age = 0
- parent = cow()
- cows = [parent]
- tmp_cows = []
- for i in xrange(1, 21):
- for cow in cows:
- cow.age += 1
- if cow.age >= 3:
- tmp_cows.append(cow())
- cows += tmp_cows
- tmp_cows = []
- print "%d %d" % (i, len(cows))
- print len(cows)
Advertisement
Add Comment
Please, Sign In to add comment