Answered step by step
Verified Expert Solution
Question
1 Approved Answer
In PYTHON please. Write a program that generates 5 random numbers between 1 and 10 and stores them in list L. Create a function that
In PYTHON please.
Write a program that generates 5 random numbers between 1 and 10 and stores them in list L. Create a function that takes list L, swap the first and the second elements and returns the list. Your program should print the original list, the list that returns from the function and its reversed. Sample output for random list L = [6,1,9,10,4]: old List: [6, 1, 9, 10, 4] New List after swapping first and last elements in old List [4, 1, 9, 10, 6] After reversing New List elements [6, 10, 9, 1, 4]Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started