Composite Functions In Python