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
write a c program to insert and delete values from stack( to perform pop and push operations) using an array data structure
Alexxx [7]

Answer:

<u>How to implement a stack in C using an array?</u>

A stack is a linear data structure that follows the Last in, First out principle (i.e. the last added elements are removed first).

This abstract data type​ can be implemented in C in multiple ways. One such way is by using an array.

​Pro of using an array:

No extra memory required to store the pointers.

Con of using an array:

The size of the stack is pre-set so it cannot increase or decrease.

3 0
2 years ago
Calls to the tostring( ) method emphasize the use of ____.
DaniilM [7]
<span>Polymorphic message
   
Methods in different classes with a similar function are given the same name. - Makes classes easier to use because programmers need to remember fewer method names. - Employed as much as possible. - Polymorphic message ex. is the toString method.</span>
5 0
3 years ago
3. This shows you the different things that all the tools can do, as you click on the tools
leva [86]
D that’s the answer I learn that in my old school
7 0
3 years ago
Which type of cell references are locked and NOT automatically updated when it’s copied
dsp73

Hi I would have to say B sorry if this answer is sucky but I'm trying my best to help you :D

4 0
3 years ago
What type of hardware enables users to interact with a computer? Check all that apply. the CPU the hard disk drive the keyboard
valentina_108 [34]

Answer:

the keyboard

the monitor

the mouse

Explanation:

just took test

6 0
3 years ago
Read 2 more answers
Other questions:
  • Categories of general purpose application software and examples each​
    13·1 answer
  • How do you delete text from a slide
    14·2 answers
  • When planning the structure of a spreadsheet, columns are for _______ items and rows are for _______ items.
    5·2 answers
  • Which information is considered free for use?
    9·2 answers
  • Read the following example cover letter: To Ms. March: I was excited to see your opening for a customer support specialist with
    13·1 answer
  • Identify some advantages of using Excel over lists, paper files, or simple word documents? Describe some disadvantages of using
    15·1 answer
  • What is the range for copper tape
    15·1 answer
  • Lucas wants to expand his vocabulary to better understand the sentence below. The insidious burglar moved through the house unhe
    7·2 answers
  • What operating system are you using? On most computers, you can answer this question by right-clicking on the "My Computer" icon
    6·2 answers
  • How to be gud at Friday night funk
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!