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
jolli1 [7]
2 years ago
9

In Python write a program that reads a list of integers into a list as long as the integers are greater than zero, then outputs

the values of the list.
Ex: If the input is:

10
5
3
21
2
-6
the output is:

[10, 5, 3, 21, 2]

Code hints: while user_input >0: #This is the number that is greater than 0 from the list that is entered.

print(user_numbers) #Prints out the numbers greater than zero that are inputted at the top part.
Computers and Technology
1 answer:
Lilit [14]2 years ago
3 0

Answer:

ansList =input().split() #get input and split it by space

ansList = [int(i) for i in ansList if int(i)>0] #turn string to integer,and get all positive integers

print(ansList)

Explanation: I think this would work for you. I leace comments in the answer.

You might be interested in
Why do i keep losing points in brainly.com and how do you lose it?
kati45 [8]

Answer:

because you are asking questions like this

Explanation:

when you ask questions you lose points

6 0
3 years ago
Read 2 more answers
The algorithm ____ is used to find the elements in one range of elements that do not appear in another range of elements.
Musya8 [376]

Answer:

A. set_union

Explanation:

The algorithm set_union is used to find the elements in one range of elements that do not appear in another range of elements.

4 0
3 years ago
Software that helps you navigate the web is called
Oksana_A [137]
Software that helps you navigate the web is called a web browser
7 0
3 years ago
given:an int variable k,an int array currentMembers that has been declared and initialized,an int variable memberID that has bee
Oksi-84 [34.3K]

Answer:

// The code segment is written in C++ programming language

// The code segment goes as follows

for (k = 0; k < nMembers; k++)

{

//check if memberID can be found in currentMembers

if (currentMembers[k] == memberID){

// If yes,

// assigns true to isAMember

isAMember = true;

k = nMembers;

}

else{

isAMember = false;

// If no

// assigns false to isAMember

}

}

// End of segment:

The following assumption were made in the code segment above.

There exists

1. An already declared and initialised int array currentMembers.

2. An already initialised int variable memberID

Line 3 initiates a loop to scan through the array

Line 6 checks for the condition below

If current element of array equals memberID then

It assigns true to isAMember and nMembers to k

Else

It assigns false to isAMember

7 0
3 years ago
Which type of security policy is intended to provide a common understandingof the purposes for which an employee can and cannot
Zigmanuir [339]

Answer:A. ISSUE-SPECIFIC

Explanation:Security policy is a set of actions an organization,Country , State or local governments put in place on order to guarantee the security of life and properties. It can also be described as the restrictions on behavior or actions of members of a society, community or an organization as well as restrictions imposed on adversaries by processes such as doors, locks, keys and walls.

Issue specific policy are policies directed to treat or handle particular factors known to aid or abate a crime. It can also be used to outline or reach at an understanding of what to used or what not to use in order to ensure effective security in an organization.

6 0
4 years ago
Other questions:
  • This is tech question related to mobile and PC.
    6·1 answer
  • Where can the Ease of Access and Speech Recognition centers be found?
    8·2 answers
  • 3) An algorithm has a run time of O(nk ) for some integer k. On an input of size 500, the algorithm takes 16 seconds to run. On
    8·1 answer
  • 7x+ 2x = 14<br>want is (x)?​
    15·1 answer
  • Write function that ask for input from a user. Use this input as input for the countdown function that we wrote using the while
    6·1 answer
  • 3.2 code practice question 2. Not in a rush.​
    15·1 answer
  • 1.
    9·1 answer
  • What was Bill Gates purpose for starting a business?
    12·1 answer
  • Please Complete in Java a. Create a class named Book that has 5 fields variables: a stock number, author, title, price, and numb
    10·1 answer
  • Resolution of bitmap graphics is typically measured in
    7·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!