Simple Algorithm Trace Table Python