C
Cndistin
First I am sorry for the title but I an newbie enough to now know how to better
word it.
The problem part of my code is
class Application:
class Moon:
def __init__(self, name):
self.name = name
def __init__(self):
self.moons = []
names = ["Io", "Europa", "Ganymeade"]
for name in names:
setattr(self, name, Moon(name))
I would like to somehow get self.moons to equal
[self.Io, self.Europa, self.Ganymeade]. I had hoped on using
self.moons as an iterant in "for" loops to be able to alter each
in turn.
Thanks in advance for any possible help.
word it.
The problem part of my code is
class Application:
class Moon:
def __init__(self, name):
self.name = name
def __init__(self):
self.moons = []
names = ["Io", "Europa", "Ganymeade"]
for name in names:
setattr(self, name, Moon(name))
I would like to somehow get self.moons to equal
[self.Io, self.Europa, self.Ganymeade]. I had hoped on using
self.moons as an iterant in "for" loops to be able to alter each
in turn.
Thanks in advance for any possible help.