Assignment 20 – function implementation

Due Monday, October 24


Task


Module hodge.py

1 + ... + n.

summation( 5 ): 15

summation( 1 ) : 1

summation( 0 ): 0



-8268.3982 * log( d )

from math import log

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

sample( 0.35 ) = 8680

sample( 0.005 ) = 43808

sample( 1.0 ) = 0



has_vowel( ox ) = True

has_vowel( eel ) = True

has_vowel( pug ) = True

has_vowel( mink ) = True

has_vowel( cat ) = True

has_vowel( lynx ) = False