How to Solve NameError: name 'zip_longest' is not defined -- itertools
Solution: Import the 'zip_longest' module
# Add the following line to the top of your code
from itertools import zip_longest
For more information:
itertools zip_longest