Expand|Select|Wrap|Line Numbers
- def L4(p):
- x=[]
- for i in range (10):
- x.append(randrange(1,7,1))
Part 1 The function that takes an input parameter an empty list. It then creates a list 10 elements long, each consisting of a random number between 1 and 6.
Part 2 Using in and slicing,its supposed to check to see if any of the elements occurred twice. If so, use the index function and slicing to check to see if it occurs 3 times in the list. If so, using the index and the slicing, check to see if it occurs 4 times. A variable to keep track of the largest number of occurrences.