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]
3 years ago
12

Write a Python program to do the following:

Computers and Technology
1 answer:
viktelen [127]3 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
What is the main idea of this article? Please someone help me. I will give brainliest answer
mart [117]
The main idea of this article is that theme parks are conducting scientific research that is benefiting the community. Hope this helps!
8 0
3 years ago
michelle works in retail and cant decide what products to include in the stores front window display. what is the first step she
Nataliya [291]

Correct answer is state the problem

5 0
3 years ago
Read 2 more answers
Free points if you name undertale character start with T
wlad13 [49]

Answer:

Toriel.

Explanation:

3 0
3 years ago
Read 2 more answers
how much should an organization consider moving into the cloud before full outsourcing starts making more business sense
PIT_PIT [208]

Answer:

47

Explanation:

capital steez

8 0
3 years ago
Read 2 more answers
Hope has now created her sublist. 1. Oxygen a. Helps living things produce energy b. Helps protect living things from harmful ra
Alex_Xolod [135]

Answer: 1. put her insertion point at the end of item 2b. 2. press enter key

5 0
3 years ago
Other questions:
  • If you’re storing some personal information like Debit/Credit card numbers or Passwords etc, on different sites for running you’
    10·1 answer
  • Writenames of eight output device.​
    8·1 answer
  • A _________ is the broadcast of various types of media over the web.
    10·2 answers
  • Write a copy constructor for carcounter that assigns origcarcounter.carcount to the constructed object's carcount. sample output
    15·2 answers
  • How can I code this in Python with only if-statements? (Only allowed to use the built-in functions int(), float(), and str().)
    8·1 answer
  • If a employee has a grade grater than or equal to 18, then he she will get 50% bonous on the basic pay. Otherwise, the employee
    5·1 answer
  • Learning Task 2: Identify what is being asked. Write your answers on your notebook 1. What Microsoft Office program is used for
    15·1 answer
  • Quick question if anyone knows? How do you give brainlist? Please tell me if you know! ( Here if a chiaki gif for your too lol )
    5·1 answer
  • An IP address specifically belongs to:
    10·1 answer
  • What are some qualities of a good game critic? What are some qualities of a bad game critic?
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!