Guest User

Untitled

a guest
Jun 21st, 2018
83
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.18 KB | None | 0 0
  1. Here are your instructions:
  2.  
  3. This project tests more of your understanding of classes and objects.
  4.  
  5. Create a new Pydev project named Lesson14_Homework.
  6. Add the project to your Python1_Homework working set.
  7. Create a new Python source file in your Lesson14_Homework/src folder named doggies.py.
  8. Write a class named Dog. Dog's __init__() method should take two parameters, name and breed, in addition to the implicit self.
  9. Bind an empty list to a dogs variable.
  10. Using a while loop, get user input for name and breed. The loop should terminate when the user enters a blank name.
  11. For each name and breed entered, create an instance of the Dog class with name and breed as arguments. Append the object to the dogs list.
  12. Each time around the loop, print the current dogs list (the name and breed of each dog).
  13. Below is an example of possible output from running the program.
  14.  
  15. Name: Snoopy
  16. Breed: Beagle
  17. DOGS
  18. 0. Snoopy:Beagle
  19. ****************************************
  20. Name: Marmaduke
  21. Breed: Great Dane
  22. DOGS
  23. 0. Snoopy:Beagle
  24. 1. Marmaduke:Great Dane
  25. ****************************************
  26. Name: Rover
  27. Breed: Mutt
  28. DOGS
  29. 0. Snoopy:Beagle
  30. 1. Marmaduke:Great Dane
  31. 2. Rover:Mutt
  32. ****************************************
  33. Name:
Add Comment
Please, Sign In to add comment