How to Solve NameError: name 'time' is not defined -- pygame

Solution: Import the 'time' module

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

from pygame import time

 

For more information:
Python pygame time