Comments updated

This commit is contained in:
SimpleArt
2020-11-20 19:06:55 -05:00
parent 68b10c3fde
commit 73461f7915
10 changed files with 159 additions and 52 deletions

View File

@ -29,10 +29,19 @@ class Gene:
def __repr__(self):
"""Create a backend string of the chromosome. Ex '1'."""
"""
Allows the user to use
repr(gene)
to get a backend representation of the gene.
"""
return str(self.value)
def __str__(self):
"""Create a printable string of the chromosome. Ex '[1]'."""
"""
Allows the user to use
str(gene)
print(gene)
to get a frontend representation of the gene.
"""
return f'[{str(self.value)}]'