Please enable JavaScript to use CodeHS

Coding in Science

Punnett Square Generator

[High School, 2-4 Hours] Students use Turtle Graphics in Python to create their own Punnett Square generator by using if/else statements, string indexing, and string methods to print the genotypes from each allele pair.

Lessons

2.1 Positioning Allele Values

  • Positioning Allele Values
  • Positioning Allele Values
  • Top Allele Placements
  • Allele Value Placement

2.2 Assigning Allele Values

  • Assigning Allele Values
  • Assigning Allele Values
  • Collecting and Printing Allele Values
  • Complete Allele Collection

2.3 Printing Genotypes

  • Printing Genotypes
  • Printing Genotpyes
  • Using Parameters to Print Title
  • determineGenotype Function

2.4 Determining Allele Order

  • Determining Allele Order
  • Determining Allele Order
  • If/Else using .isupper()
  • Dominant Allele First

2.5 Percent Genotype Dominance

  • Percent Genotype Dominance
  • Percent Genotype Dominance
  • Using Booleans and Return Statements
  • determineDominantPercentage Function

2.6 Print Total Genotype Dominance

  • Print Total Genotype Dominance
  • Print Total Genotype Dominance
  • Finalize Punnett Square Generator

Courses that include this module