Python Program Using Functions To Solve