Amazon interview question

Solve a table test with python