How to Solve NameError: name 'randint' is not defined -- random

Solution: Import the 'randint' module

To Solve the error, add the following line to the top of your code.

from random import randint

 

For more information:
Python random randint