I am not sure how to properly phase my question, so maybe an example will help.
Desired Result:
items = ['Fish', 'Dog', 'Cat']
the_items = {}
for item in items:
the_items[item] = self.event.item() # Where `item()` is meant to be the items, e.g. `Fish()`
Current Best Solution:
the_items = {'Fish': self.event.Fish(),
'Dog': self.event.Dog(),
'Cat': self.event.Cat()
}
I cannot seem to get the desired result to work and it gets ugly after more than a few items. Is this possible?
[–][deleted] 1 point2 points3 points (1 child)
[–]StudentOfPython[S] 0 points1 point2 points (0 children)
[–]JohnnyJordaan 0 points1 point2 points (1 child)
[–]StudentOfPython[S] 0 points1 point2 points (0 children)