Morning,<br><br>  I dug out some old code from 5 years ago to clean up and get in working order. It's a simple agent based model. I have class called Ant which contains all the ant-like functions.<br><br>I have a list that tracks the ants but I did this is a very crude way. I basically copied and pasted everything in there like this:<br>
<br>ants = [Ant("Red_1","Red","yellow_food"),Ant("Yellow_1","Yellow","red_food"),<br>          Ant("Red_2","Red","yellow_food"),Ant("Yellow_2","Yellow","red_food"),<br>
          Ant("Red_3","Red","yellow_food"),Ant("Yellow_3","Yellow","red_food"),<br>          Ant("Red_4","Red","yellow_food"),Ant("Yellow_4","Yellow","red_food"),<br>
          .......]<br><br>I couldn't figure out how to populate the list from a user input. Say if the user wanted 50 Red and 50 Yellow ants. So it's hardcoded at 500 which is not an elegant solution.<br><br>I went back to work on this over the past couple of days but still can't figure out how to populate the list so I end up with Red_1 then Red_2 etc...<br>
<br>What would be a good python way to do this?<br><br>Thank you for your time.<br>ara<br clear="all"><br>-- <br>Quis hic locus, quae regio, quae mundi plaga. Ubi sum. Sub ortu solis an sub cardine glacialis ursae.<br>