class Country(object):
""" Modeling a country immigration. """
def __init__(name, immigrants, population, disease_numbers):
self.name = name
self.immigrants = immigrants
self.population = population
self.disease_numbers = disease_numbers
I have the follow class , that are more attributes .. Every year the population changes and at the end of x years im trying to built o ordered dictionary that will show me which country have the highest population and the least people with diseases... How do I built a dictionary that updates on every year/ turn and give me this info at the end.
How can I get information of the stats on the last turn?
Let me clarify the question.
All i need is at the end of the simulation to have a ordered dictionary.
d = {'self.name' : London
('self.immigrants' : 15000
'self.population' : 500000
'self.disease_numbers' :3000) ,
'self.name' : Madrid
('self.immigrants' : 17000
'self.population' : 5000
'self.disease_numbers' :300)}
Then be able to pick for example in this case London because of higher number of people with a disease. So thinking through it could almost be a new method that return the city with the higher number of people with the disease.