Assignment 25 — functional chrestomathics

Due Wednesday, April 1


Requirements


Module magnificent.py


Function future_me( a, y )

A 15 year-old will be 81 in 2086

A 19 year-old will be 98 in 2099



Function manhattan_distance( a1, s1, a2, s2 )

Corners ( 6 , 59 ) and ( 7 , 34 ) are 1.4 miles apart

Corners ( 2 , 47 ) and ( 6 , 238 ) are 10.15 miles apart



Function relate( x, y )

kiwi is equal to kiwi

apple comes before banana

orange comes after melon



Function youngest( y )

19 year old can date a 16 year old

22 year old can date a 18 year old



Function is_dateable( y1, y2 )

15 year-old can date a 22 year-old is True

22 year-old can date a 15 year-old is False

19 year-old can date a 18 year-old is True



Function mutually_dateable( y1, y2 )

25 year-old can date a 65 year-old and vice-versa is False

20 year-old can date a 18 year-old and vice-versa is True



Function middle( s )

Middle character of abcde is c

Middle character of abcdef is cd

Middle character of abcd is bc

 


 
  © 2020 Jim Cohoon   Resources from previous semesters are available.