I am trying to do this project but I am lost. This is the first time I have done a program like this and I don't know where to start. I tried to have the dice.roll = a range of 1 to 6, but I think I was not supposed to since it says the name "random" is not defined. I have no idea what I am doing incorrectly and do not have anyone available to explain.
# ************************
# Step 1: import from dice the Dice class
from dice import Dice
# Step 2: For the variable name dice, assign the Dice() class
class Dice():
results=[]
# Step 3: Declare an empty results list
results=[]
# Step 4: Roll the dice 1000 times
for roll_num in range(1000):
dice.roll= random.randint(1,6)
# stores the results for each single dice roll in a list
result = dice.roll()
results.append(result)
# analyze the results
frequencies = []
# range starts at 0, increments by 1 and stops just before the last number
# Uses +1 to stop just before 7 for 1-6 sides
for value in range(1, dice.num_sides +1):
# Step 5: call the value as you count the results
frequency = results.count()
# Step 6: similar to the results list, keep appending or adding the frequency
frequencies.append()
# Step 7: Print the frequencies to the Python Shell
print()