On Sunday, February 5, 2017 at 11:27:19 PM UTC, pha...@u.rochester.edu wrote:
> Hi everyone. I'm new to python and have hit a bit of a wall with an 
> assignment I'm working on. I created a number of classes and instantiated 
> them, now I need to create a list out of them. I am looking for something 
> more elegant than appending each object to the list as I instantiate it. I 
> tried setting up an if loop, but didn't get far with it. Any suggestions?

If loop, for heavens sake :)

Try one of these beasties instead 
https://docs.python.org/3/tutorial/datastructures.html#list-comprehensions

Kindest regards.

Mark Lawrence.
-- 
https://mail.python.org/mailman/listinfo/python-list

Reply via email to