#python language

11 messages · Page 1 of 1 (latest)

tribal saddleBOT
#

@green blaze

mahamhameed Uploaded Some Code

1.Read the code from line 123 to line 137. This is the basically the selection.
Remember how we talk about there are certain things about controlling population?
Please explain how we make sure that the population, when going through a selection,
does not shrink over generation. You may simply explain this as comments in a Python
file as opposed to in a Word file.
Note that the code from line 123 to line 137 is divided into two small blocks. Use that as
the hint.
2. The code we've just examined has one functionality of selection. So, we really should
wrap that into one function named 'select'. Note that in this file there is no class named
'Population'. So, you should make this function a static method that belongs to the class
named 'Individual', or a simple function that resides outside the class named
"Individual'. Please think about what the inputs and output of this function are before
you start coding. Once you have created the function/method, you should
remove the block of code from line 123 to line 137.
3. There are two class methods (mutated genes on line 25, create gnome on line 35) that
belong to the class named 'Individual'. In general, a class method does not apply to an
instance but to a class. So, to be perfectlv correct, so there should not be 'self' in the
inputs of any of the two methods just mentioned here. Please modify these two class
methods so thev confirm to the convention iust highlighted.

Uploaded these files to a Gist
sand gyro
#

What is your question???

green blaze
#

Please have a look at the attached file

sand gyro
#

Tell me what I'm looking for

#

This looks like a school assignment

green blaze
#

python

sand gyro
#

I can see it's python

#

What do you need help with

green blaze
#

question 1

sand gyro
#

What about it do you need help with

green blaze
#

how can I explain how the population, when going through a selection, does not shrink over generation