Santa has arrived at AGS and he has 10 different types of presents for your peers. He is going to give these out but he needs your help to allocate these to people randomly. The first skill that you will need to use is random numbers.
Requirements: -
Set up the list of presents using [" "] - See example below
Ask for how many people are in the class
Complete a loop for that many times
Inside the loop generate a random number between the range of the list
Pick an item from the list using the random number in the array i.e presents[i]
output each present that was generated using the random number.
Generate Random Numbers
You can see from this skill that you can import the library random and then on the back of this, you can pick a random number between a start and finish number. In the example below we have 0 - 20. You will need to adjust this for your program.
import random
# Generates a random number between
# a given positive range
r1 = random.randint(0, 20)
print(r1)
Arrays / Lists
You are going to need to make sure that you put the 10 random presents of choice into a list such as :
presents = ["Skateboard","Playstation","Vouchers"]
Iteration
You will need to ask them how many people in your class and then you're going to need to output the present given to them by using the index of the list. If you look back at day 4 it might help you complete this.