I am doing a program that simulates population growth, but I am not competent enough to understand how to assign a variable to a newly generated person.
Here's my (very much incomplete) code so far:
from random import seed
from random import randint
seed()
m = "male"
f = "female"
class Person:
def __init__(self, gender, age):
if gender == 0:
self.gender = m
else:
self.gender = f
self.age = age
def person_Birth():
x = Person(randint(0,1), 0)
return x
new_Person = person_Birth() #here's the problem
Every time i want to "cause birth" to a new human, how can i store his/her information separately i.e. automatically assign a new variable to store his/her information without explicitly stating a new variable?
I'm sorry if this is confusing to you, I am not sure of the correct terms.