How to Solve NameError: name 'string' is not defined

Erorr: name 'string' is not defined

NameError: name 'string' is not defined

Solution: Import the 'string' module

# Add the following line to the top of your code
import string

 

For more information:
Python string