1answer.
Ask question
Login Signup
Ask question
All categories
  • English
  • Mathematics
  • Social Studies
  • Business
  • History
  • Health
  • Geography
  • Biology
  • Physics
  • Chemistry
  • Computers and Technology
  • Arts
  • World Languages
  • Spanish
  • French
  • German
  • Advanced Placement (AP)
  • SAT
  • Medicine
  • Law
  • Engineering
SCORPION-xisa [38]
4 years ago
12

Write a Python program to do the following:

Computers and Technology
1 answer:
viktelen [127]4 years ago
5 0

Answer:

(b)Tb = Ta[:3]

(c)Tc = Ta[-3:]

(d)Td = Tb + Tc

Explanation:

In order to generate random number in python, we need to first import random() function from random module

This function will generate a float number between 0 and 1, to make it between 1 and 15, we add 1 to the multiplication between the random number and the range differences

(a)

from random import random()

L = []

for i in range(10):

    L.append(1 + round(random()*14))

Ta = tuple(L)

(b) To copy the first 3 elements of tuple Ta, we simply go from : to 3

Tb = Ta[:3]

(c) To copy the last 3 elements of tuple Ta, we simply go from -3 to :

Tc = Ta[-3:]

(d) To concatenate the 2 tuples, we simply add them up

Td = Tb + Tc

You might be interested in
Help please fast
Pachacha [2.7K]
Bookmark because you can go back to it at any given time to re use it
4 0
3 years ago
Read 2 more answers
What plan can businesses use to protect sensitive data from malicious attacks?
Anna11 [10]

Answer:

cybersecurity

Explanation:

it's either that or anti-spywhare but cybersecurity seems more likely

6 0
3 years ago
Read 2 more answers
Periodically adding, changing and deleting file records is called file. A) Updating B) Upgrading C) Restructuring D) Renewing E)
igomit [66]
Periodically adding, changing and deleting file records is called file updating. The correct answer is A. 
4 0
4 years ago
Read 2 more answers
Linda is the owner of Souvenirstop, a chain of souvenir shops. One of the shops is located at the City Centre Mall. Though the s
Klio2033 [76]

Answer:

attraction and attention

6 0
3 years ago
Write down the appropriate technical term of following statements.​
MrRa [10]

Answer:

it is not seeing full. please give full

8 0
3 years ago
Other questions:
  • Which of the following are types of formatting you
    12·2 answers
  • How do I learn coding??? ​
    5·2 answers
  • Assume you have just started a new job, have a car loan, and have a student loan. You have just received a cash gift of $1,000 f
    14·1 answer
  • Upgrading only the motherboard will give some performance improvement to a computer system. Why would the improvement be limited
    14·1 answer
  • True or False? Using your traffic analytics report, you can see the source of traffic to your website
    13·1 answer
  • Role of memory in a computer system
    10·1 answer
  • I want to get an output picture in python but it says this. I'm using turtle
    12·1 answer
  • Anne wants to hide her age by converting it from 13 to 1101. Which number system is Anne converting to?
    13·1 answer
  • rue or false: The first web browser was introduced to the public in the 1970s and started the explosive growth of the Internet i
    15·1 answer
  • Software is in -----language​
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!