Question: Python Print the 3 lines(output) after the function returns, NOT inside the function. Thank you. Write a program that generates 5 random numbers between 1

Python

Python Print the 3 lines(output) after the function returns, NOT inside the

Print the 3 lines(output) after the function returns, NOT inside the function. Thank you.

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

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!