Main content
Course: Intro to computer science - Python > Unit 3
Lesson 5: Simulating populationsProject: Natural selection
Instructions
Simulate a population
See Instructions: Natural selection.
- Choose two variations of a trait that Neeblers might have, like small and big.
- Model how each variation might influence a Neebler’s chance of survival, including some randomness.
- Model reproduction, where children inherit their parent’s trait variation.
- Repeat the survival and reproduction steps until the population dies out or some number of generations have passed.
We’ve started a simulation with the example of small Neeblers. You can choose a different trait to vary and rewrite the program, or you can extend the existing program to include a big Neebler variation.
How do different starting population sizes and survival rates influence which Neebler variation thrives?