Advertisement
Guest User

Untitled

a guest
Aug 8th, 2012
537
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. """
  2. Some simple classes to test network
  3. pickling and unpickling
  4. """
  5.  
  6. class Spaceship():
  7. def __init__(self, name, engines):
  8. self.name = name
  9. self.engines = engines
  10.  
  11. def info(self):
  12. return ("I'm a " + self.name +
  13. " class spaceship and I have "
  14. + str(self.engines) + " engines")
  15.  
  16. class Planet():
  17. def __init__(self, name, moons):
  18. self.name = name
  19. self.moons = moons
  20.  
  21. def info(self):
  22. return ("I'm a planet, my name is "
  23. + self.name + " and I have "
  24. + str(self.moons) + " moons")
  25.  
  26. class Journey():
  27. def __init__(self, spaceship, planet):
  28. self.spaceship = spaceship
  29. self.planet = planet
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement