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
A direct-mapped cache holds 64KB of useful data (not including tag or control bits). Assuming that the block size is 32-byte and
Cerrena [4.2K]

Answer:

A) Number of bits for byte = 6 bits

B) number of bits for index = 17 bits

C) number of bits for tag = 15 bits

Explanation:

Given data :

cache size = 64 kB

block size = 32 -byte

block address = 32 -bit

number of blocks in cache memory  

cache size / block size = 64 kb / 32 b = 2^11 hence the number of blocks in cache memory = 11 bits = block offset

A) Number of bits for byte

log _{2} (6)^2 = 6  bits

B) number of bits for index

block offset + byte number

= 11 + 6 = 17 bits

c ) number of bits for tag

= 32 - number of bits for index

= 32 - 17 = 15 bits

5 0
3 years ago
What is the most common option for fighting radiation?
tigry1 [53]
Lead Sheets, Plates, Slabs, & Foils.

Lead Shot
6 0
3 years ago
How do you stop your questions on here from getting your questions from getting removed?
Amanda [17]

you don't........................

7 0
3 years ago
Read 2 more answers
A function checkZeros accepts three double parameters. It checks to see if the sum of all three parameters is equal to zero. If
blagie [28]

Answer:

Explanation:

The following code is written in Java. It creates the interface/prototype, the function, and the main method call. The function takes in the three int parameters, adds them, and then checks if the sum equals zero, outputting the correct boolean value. Output can be seen in the picture attached below. Due to technical difficulties I had to add the code as a txt file below.

6 0
2 years ago
FREE 10 POINTS THE EASIEST QUESTION EVER I AM NEW SO I DONT KNOW HOW TO MARK SOMEONE THE BRAINLEAST ????????????????????????????
umka2103 [35]

Usually you can just report the question as useless or just report in in general. But I myself have read some answers and they dont even pertain to the question, it confuses me alot

8 0
3 years ago
Read 2 more answers
Other questions:
  • Steps needed to deposit cash on cash deposit machine
    6·1 answer
  • Will the Python code below print something? And will it terminate?
    9·1 answer
  • NOTE: in mathematics, division by zero is undefined. So, in C , division by zero is always an error. Given a int variable named
    10·1 answer
  • Which one of the following is a correct declaration for a method named passAList that has as arguments an array list myList of s
    8·1 answer
  • Most presentation programs allow you to save presentations so they can be viewed online by saving them as ____
    5·2 answers
  • A data center needs to ensure that data is not lost at the system level in the event of a blackout. Servers must stay operable f
    6·1 answer
  • What is a type of transition used for music in Earsketch
    11·1 answer
  • Ask how many apples the user wants. Ask how many people the user will share the apples with. Find out how many apples will remai
    7·1 answer
  • Use the drop-down menus to complete each sentence.
    8·2 answers
  • What is the difference between referential and entity integrity
    11·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!