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
In which client/server relationship can a computer act as both a client AND a server? Select one: a. X-Windows b. SSH c. Classic
Ivanshal [37]

Answer: d) Peer-to-Peer

Explanation:

Peer-to-peer(P2P) is the the system in which computer system are linked with reach other through internet connectivity. There is no requirement of central server for file sharing and transmission. Thus, it can act as client and file server in a network for file and data transmission.

  • Other options are incorrect because classic view,X-Window and SSH(Secure Shell) are not the relationships that have the potential to behave as client and server for cooperation of programs.
  • Thus, the correct option is option(d).
3 0
3 years ago
Write a Coral program using integers userNum and x as input, and output userNum divided by x four times.
ss7ja [257]

Answer:

second_int = "Enter the second integer: "

usernum = int(input("Enter the first integer: "))

x = int(input(second_int))

usernum = usernum // x

print(usernum, end= ' ')

usernum = usernum // x

print(usernum, end= ' ')

usernum = usernum // x

print(usernum, end= ' ')

usernum = usernum // x

print(usernum)

Explanation:

im good

7 0
3 years ago
The open items on your computer are displayed here.
koban [17]
The GUI or Graphical <u /><u></u><em />User Interface.
7 0
3 years ago
What is microsoft certification?
BabaBlast [244]
Microsoft certification is a series of programs that provide certification of competence in Microsoft products.
6 0
3 years ago
Step 1: Configure the initial settings on R1. Note: If you have difficulty remembering the commands, refer to the content for th
Andru [333]

Answer:

The configuration of the R1 is as follows

Explanation:

Router>enable

Router#show running-config

Router#show startup-config

Router#configure terminal

Router(config)#hostname R1

R1(config)#line console 0

R1(config-line)#password letmein

R1(config-line)#login

R1(config-line)#exit

R1(config)#enable password cisco

R1(config)#enable secret itsasecret

R1(config)#service password-encryption

R1(config)#banner motd #Unauthorized access is strictly prohibited#

R1(config)#end

R1#exit

R1>enable

R1#copy running-config startup-config

R1#show flash

R1#copy startup-config flash

3 0
3 years ago
Other questions:
  • All of the following are search operators EXCEPT _______________. a. AND b. OR c. NOT d. GET
    12·2 answers
  • The arithmetic logic unit (alu) controls all of the functions performed by the computer's other components and processes all the
    7·1 answer
  • What nondestructive testing method requires little or no part preparation, is used to detect surface or near-surface defects in
    7·1 answer
  • Explain how to identify a starting position on a line.
    15·2 answers
  • After a chart has been inserted and formatted, is it possible to change the data range it refers to or to add new rows of data?
    14·1 answer
  • which of the following statements about matter is true a.matter is anything that occupies space and possesses mass b.matter can
    5·2 answers
  • Create a variable in php to store your university information and parse using jQuery Ajax and print your name. The variable must
    12·1 answer
  • Correct all the mistakes in the following sentence:
    15·2 answers
  • What is a mod in programming?<br><br> Give more Java questions
    12·1 answer
  • Should a UDP packet header contain both Sour Port # and Destination Port #?
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!