I'm having difficulty figuring out how to append two user inputs into a list as a tuple. I would also like to call the list and enumerate the list (e.g., 0. dog_name:dog_breed). I'm not sure how to call display or if it is even written properly.
Here's what I have so far:
""" Acquire Dog name and breed from user and bind to list """ import sys class Dog: def __init__(self, name, breed): self.name = name self.breed = breed def __str__(self): return "%s:%s" % (self.name, self.breed) def display(self): for i in enumerate(self): print(i, "%s:%s" % self.name, self.breed) if __name__ == "__main__": dogs = list() first_inp = "Name: " second_inp = "Breed: " while True: dog_name = input(first_inp).strip() dog_breed = input(second_inp).strip() dogs = Dog(dog_name, dog_breed) print(dogs)
Any help would be greatly appreciated.