How to Solve NameError: name 'ascii_letters' is not defined -- string
Solution: Import the 'ascii_letters' module
To Solve the error, add the following line to the top of your code.
from string import ascii_letters
For more information:
Python string ascii_letters