I'm still new to Python and Programming in general, so I need simple explanations! I don't even know what this dictionary thing you'r talking about is!
I'm trying to create a game for my little sister. It is a Virtual Pet sort of thing and the Pet has toys to play with.
I created a class Toy and want to create a function, getNewToy(name, data1, data2, data3, data4, data5).
I want this function to create a new instance of the class Toy, and I want the function to be able to be called multiple times each time creating a new instance.
In my experience you create an instance with:
class Toy:
def __init__(self, name, data1, data2, data3, data4, data5):
pass
myToy = Toy(myToy, 1, 2, 3, 4, 5)
then to use methods from the class with:
myToy.method1()
Seeing as I want to have the ability to have multiple toys, each with a playWith() method I want the instance to reflect the name of the Toy each time one is called.
I want the instance to be different each time I call the method getNewToy(,...) and the instance to reflect the name.
Remember I'm new to programming, so can you keep explanations simple.