Question: Write a python program that takes a list of names as input and does the following. Shuffles the list. Generates a random number between 1
Write a python program that takes a list of names as input and does the following.
Shuffles the list.
Generates a random number between 1 and the length of the list.
Uses the generated random number as an index of the shuffled list to find the corresponding name in the list and declares the person as a winner.
Use the list given below to check your program and display the winner.
fistnames = ['Liam', 'Noah', 'Oliver', 'Elijah', 'James', 'William', 'Benjamin', 'Lucas', 'Henry', 'Theodore', 'Olivia', 'Emma', 'Charlotte', 'Amelia', 'Ava', 'Sophia', 'Isabella', 'Mia', 'Evelyn', 'Harper']
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
