Add python solution to challenge 31

Signed-off-by: James Durand