Question: (a) Use a for loop and a random integer generator to generate 10 random integers in 1 through 15. Store the random integers in a
(a) Use a for loop and a random integer generator to generate 10 random integers in 1 through 15. Store the random integers in a tuple. Display the tuple. [Hint: you may want to store the random integers in a list first and then convert the list to a tuple] (b) Create a new tuple. Copy the first three elements of the tuple in part (a) to this tuple. Display this tuple. (c) Create a new tuple. Copy the last three elements of the tuple in part (a) to this tuple. Display this tuple. (d) Concatenate the two tuples in part (b) and part (c). Display the concatenated tuple. (e) Sort the concatenated tuple. Display the sorted tuple.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
