subject

Write a python program to do the following:
(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. the following is an example. there is no user input in this program.

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 23.06.2019 02:30
People with high self-esteem: accept their strengths and weaknesses. believe that failed experiences are failures of their whole self. feel good about who they are only when they reach total success. need positive external experiences to counteract negative feelings that constantly plague them.
Answers: 1
question
Computers and Technology, 23.06.2019 05:00
Acompany is inviting design for its new corporate logo from its users. this is an example of ? a. crowdfunding b. crowdvoting c. crowdsourced design d. crowdtracking
Answers: 3
question
Computers and Technology, 24.06.2019 08:30
Why might you choose to create a functional resume
Answers: 1
question
Computers and Technology, 24.06.2019 13:30
Write a program that uses a two-dimensional array to store the highest and lowest temperatures for each month of the year. the program should output the average high, average low, and the highest and lowest temper- atures for the year. your program must consist of the following functions: a. function getdata: this function reads and stores data in the two- dimensional array. b. function averagehigh: this function calculates and returns the average high temperature for the year. c. function averagelow: this function calculates and returns the aver- age low temperature for the year. d. function indexhightemp: this function returns the index of the highest high temperature in the array. e. function indexlowtemp: this function retur
Answers: 3
You know the right answer?
Write a python program to do the following:
(a) use a for loop and a random integer generator...
Questions
question
English, 14.04.2021 23:50
question
Mathematics, 14.04.2021 23:50
question
Mathematics, 14.04.2021 23:50
question
Chemistry, 14.04.2021 23:50
Questions on the website: 13722361