AMD interview question

Flatten a nested Python list