Hello,
This post is the follow-up of my previous post (Create and retrieve object list in Python).
I had to modify my code in the following way :
script1
#!/usr/bin/python
class Porsche:
""" class representing a Porsche """
def __init__(self, color):
self.color = color
def create_porsche(parameter_1, parameter_2):
myPorsche = Porsche(color = parameter_1)
myPorsche2 = Porsche(color = parameter_2)
create_porsche(parameter_1 = 'blue', parameter_2 = 'red')
porsche_container = (myPorsche, myPorsche2)
and I'd like to have porsche_container = (myPorsche, myPorsche2) working the same way as in my previous script :
old script 1
#!/usr/bin/python
class Porsche:
""" class representing a Porsche """
def __init__(self, color):
self.color = color
myPorsche = Porsche(color = 'blue')
myPorsche2 = Porsche(color = 'red')
porsche_container = (myPorsche, myPorsche2)
How can I do that please ?
rgds,