Assignment 21 – function implementation

Due Tuesday, April 6


Task


Module hodge.py

1 + ... + n.

summation( 5 ): 15

summation( 1 ) : 1

summation( 0 ): 0


-8268.3982 * log( d )

Because the age is an estimate, it is always truncated to integer. I suspect the built-in int() and the math.log() functions should prove useful.

sample( 0.35 ) = 8680

sample( 0.005 ) = 43808

sample( 1.0 ) = 0


has_vowel( oxen ) = True

has_vowel( urchin ) = True

has_vowel( mink ) = True

has_vowel( rabbit ) = True

has_vowel( lynx ) = False

 


  🦆 © 2022 Jim Cohoon   Resources from previous semesters are available.