python: 'rand' is not defined, using random in a class
Sorted by: 2 The module is called random, not rand, but you didn't import it correctly: # Import the *module*, not the function import random # Use the correct name in your method self.pursue_dice = random.randint (1,100) The statement from random import random only imports a reference to the random.random () function, not the module itself.