Flatten List Python Using Nested For Loop