Add python solution to challenge 40

Signed-off-by: James Durand