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
aleksandrvk [35]
2 years ago
13

Write a program that (a) generates a vector with 20 random integer elements with integers between -29 and 30, (b) replaces all t

he negative integers with 100.
Computers and Technology
1 answer:
Ghella [55]2 years ago
5 0

Answer:

import random

randomlist = []

for i in range(0,20):

n = random.randint(-29,30)

if n < 0 :

n = 100

randomlist.append(n)

print(randomlist)

Explanation:

The random module is first imported as it takes care of random. Number generation.

An empty list called randomliay is created to hold the generated random integers.

Using a for loop, we specify the range of random numbers we want.

Inside the for loop ; we attach our generated random integer which will be in the range (-29 to 30) in a variable n

For each n value generated, if the value is less than 0( it is negative, since all the values are integers), replace the value with 100.

You might be interested in
Circuitry can be either basic or ___________.
Sonja [21]
I think it would be A. Ohm's law.
hope this helps.
6 0
3 years ago
Read 2 more answers
Punitive consequences for downloading software illegally is
Dimas [21]

Answer:

I think that the answer is A

3 0
2 years ago
Which task would a database administrator preform?
neonofarm [45]
Sr I don’t know what about it today lol but it’s just a weird thing about to be with my buddy who knows what to say lol
5 0
2 years ago
Read 2 more answers
7. What information appears on the vertical axis?
ivann1987 [24]

Answer: range of values

Explanation:

3 0
3 years ago
You are preparing to give a presentation at a client’s location using your mobile device and a large screen TV. You have success
Ray Of Light [21]

Answer:

The most probable reason for this is A.

Explanation:

B should be wrong because the TV being connected to a different network segment still means that it is on the Wi-Fi network, it is just using a different switch or a repeater.

C should be wrong because the brightness of the TV does not have anything to do with being able to connect to the phone.

D should be wrong because in the question itself it says that "you tap the mirroring option on your device" which clearly means that the mobile device supports display mirroring.

The answer should be A, if the device and the TV are not on the same Wi-Fi network, than they simply can not connect and the mirroring can not be done.

I hope this answer helps.

7 0
3 years ago
Other questions:
  • How often should you typically monitor your checking account? Yearly Daily Every three months Monthly
    10·2 answers
  • A Windows user has been successfully saving documents to the file server all morning. However, the latest attempt resulted in th
    9·2 answers
  • #include &lt;iostream&gt;
    9·1 answer
  • HELP ME ASAP PLS BEING TIMED
    8·2 answers
  • Numeric data is stored in ___________ for direct processing.
    6·2 answers
  • Original Problem statement from the Text: A retail company must file a monthly sales tax report listing the sales for the month
    7·1 answer
  • A computer essentially takes input, processes it, and produces output. Which person developed a machine in the mid-1880s that ac
    6·1 answer
  • For a direct-mapped cache design with a 64-bit address, the following bits of the address are used to access the cache
    7·1 answer
  • You have a technical interview for a new position in digital media. One of the questions you are asked is this: “A client asks y
    13·1 answer
  • ________ is a record in a relational database.
    6·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!