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

Solution: Import the 'choices' module

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

from random import choices

 

For more information:
Python random choices