Class 24 — Wednesday October 20

Module implementation and usage

Practice makes perfect — Is more than a platitude — Take it to your heart


Look both ways


Agenda


Reddit video


Slides


Downloads


To do


Module olio

Function voting_age()

x = olio.voting_age()

y = olio.voting_age()


Function has_blanks( s )

x = 'CS 1112'

y = 'the_aardvark_said_arf_arf'

b1 = olio.has_blanks( x )

b2 = olio.has_blanks( y )


Function great_seal()

olio.great_seal( )

print()

olio.great_seal( )

print()

produces as output

E Pluribus Unum

E Pluribus Unum


Function a_ing( n )

olio.a_ing( 5 )

print()

olio.a_ing( 1 )

print()

olio.a_ing( 3 )

produces as output

a

aa

aaa

aaaa

aaaaa

a

a

aa

aaa



Module primal

Purpose


Terminology


Observation


Function is_factor( x, y )


Function is_prime( x )

  • Could is_factor() help?
  • What are the possible range of values do we need check for being possible factors of x.
  • Does the function need a loop?

Function are_relative_primes( x, y )



cel from primal cartoon


Slide show