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]
3 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]3 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
What is Key benefit of using ram in a computer
deff fn [24]
There is not really a key benifit, but it does help with little things.
7 0
3 years ago
I don't understand how to write both. If I repeat the first code but with 3 and 6 it doesn't work.
hram777 [196]

It looks like you need to get both numbers from the input. Try doing something like this:

print(int(input()) + int(input()))

4 0
3 years ago
The freemen's bureau was the U.S.' first ____ program.​
Ludmilka [50]

Answer:

welfare

Explanation:

The Freemen's bureau was the first Welfare program in the US that was put forward in the year 1865 just after the assassination of Abraham Lincoln. It was headed by Oliver O Howard. And it was brought for providing the food, clothing, medical care, and education to the recently freed white refugees and the freed slaves. And it was supposed to be a kind of welfare.  

6 0
4 years ago
Choose the term that best completes each sentence.
olga2289 [7]

Answer:

The answer to the above questions is given in explanation section:

Explanation:

abstraction hides the details about a specific piece of information.

The suitable match for this is Data

Because the word "Piece of information " can only be referred to data not to process.

Now look at the second

abstraction hides the details about a specific process

The suitable match here is procedural.

because specific process can only be referred to procedure not to data.

6 0
3 years ago
Read 2 more answers
What process identifies and grants access to a user who is trying to access a system? A. Credibility
xeze [42]

Answer:

Option C is the correct answer for the above question

Explanation:

Authentication is used to grant a person to use the system so that no other person can hack the data of the system. It is done by some unique id which is provided to the user of that system. When any person wants to use the system he needs to use that a unique id and sometimes password and some other information to use the system.

The above question asked about the process through which the user of the system grants access to use the system only. So the process is Authentication. hence Option C is correct because it states about the process Authentication while the other is not because--

  • Option a states Credibility which is not the process to enter the system.
  • Option b states Authorization which is used if the system gives access to the user, not the user can take on its own.
  • Option d states Honesty which is not the process to enter the system.
8 0
3 years ago
Other questions:
  • Internet control message protocol (icmp) is a method of ip address assignment that uses an alternate, public ip address to hide
    7·1 answer
  • What is ment by creative middle way solution
    6·1 answer
  • Which is the correct formula to add the values in cells A1 and B1? A. SUM(A1+B1) B. =SUM(A1+B1) C. =SUMA1+B1 D. A1+B1
    9·2 answers
  • What is the FICO system?
    12·1 answer
  • Select the correct answer.
    5·1 answer
  • ____________ occurs when a provider does not support data export or when a provider's service is unavailable through others.
    11·1 answer
  • A software development company wants to reorganize its office so that managers and the Computer Programmers they supervise can b
    13·2 answers
  • You are planning a program to find the maximum heart rate recommended for patrons of a gym where you have a part-time job. One f
    13·1 answer
  • Here is the problem specification: An Internet service provider has three different subscription packages for its customers: Pac
    5·1 answer
  • Test unit 8 edhesive answers ​
    15·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!