Question: Write a function named create_list that takes in a list size and returns a list of random numbers from 1-6. i.e., calling create_list(5) should return
Write a function named create_list that takes in a list size and returns a list of random numbers from 1-6. i.e., calling create_list(5) should return 5 random numbers from 1-6. (Remember, Chapter 7 has code showing how to do something similar, creating a list out of five numbers the user enters. Here, you need to create random numbers rather than ask the user.) To test, use this code against the function you wrote:
| my_list = create_list(5) print(my_list) |
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
