# This program was written to demonstrate that choosing a random number # between 2 and 12 is NOT the same as choosing two random numbers # between 1 and 6 and adding them (like dice) import turtle import random # This list of turtles will draw the columns of the histogram tList = [] numbins = 13 for i in range(numbins): # Each time round the loop we'll create a new turtle ## Create a turtle called nt ## Put the turtle's pen up # Each turtle has a different position on the baseline nt.goto(i*15-100, -150) # All start on same baseline ## Put the turtle's pen down ## Set the turtle's heading to point upwards (90 degrees) ## Set the turtle's pen size to 4 ## Set the turtle's colour to red ## Set the turtle's speed to 10 ## Add the new turtle to the list tList for i in range(1000): ## Get a random integer in the range 0 to 12 (use random.randint()) ## Use the random number to select the appropriate turtle ## from the tList amd move it forwards 2 steps ## ------------------------------------------------------ ## When you have this working, change the line that generates the ## random number to generate two random numbers in the range 0 to 6 ## and add them together. What happens to the shape of the histogram?