When I need to remember the spelling for a list comprehension with more than one loop in Python, I find the following mnemonic helpful:
write the for statements in the same order you would write a nested loop
For example, suppose we have a nested list that we wish to flatten:
>>> nested_list = [[1, 2, '5!'], (3, 'sir!')]