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]
1 year 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]1 year 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
even if we reach that state where an AI can behave as human does,how do we measure if AI is acting like a human?
xxTIMURxx [149]

A person can be able to measure if AI is acting like a human by the use of   Turing test.

<h3>How do we measure of artificial intelligence is acting like a human?</h3>

One can measure if AI is  Acting humanly via the use of a human who is said to interrogates the program and also the use of another person through the use of a terminal simultaneously.

Note that If after some amount of time or period, the interrogator is said to be unable to tell which is which, the program is said to have passed. To pass this test it is one that needs natural language processing.

Hence, A person can be able to measure if AI is acting like a human by the use of Turing test.

Learn more about AI from

brainly.com/question/25523571

#SPJ1

4 0
1 year ago
Edhisive 3.5 code practice
Amanda [17]

Answer:

x = int(input("What grade are you in? "))

if (x == 9):

   print ("Freshman")

elif (x == 10):

   print("Sophomore")

elif (x == 11):

   print ("Junior")

elif (x == 12):

   print("Senior")

else:

   print ("Not in High School")

Explanation:

7 0
2 years ago
If you are using a sprite for your MakeCode Arcade game, which code block
xeze [42]

Answer:

set mySprite block

Explanation:

BRAINLIEST?

8 0
2 years ago
Read 2 more answers
Which is the last step in conducting a URL search?
dimulka [17.4K]
The user's browser renders the html code as a visual web page
3 0
3 years ago
When molten igneous material intrudes into rock _____ metamorphism can occur.
Gnom [1K]
B) Contact metamorphism can occur.
8 0
3 years ago
Other questions:
  • Why do we need the Domain Name System (DNS)? Given the domain name www.flamingflamingos.eu, what is the top level domain in this
    5·1 answer
  • Below is a 4-bit down-counter. What is the largest number of the counter if the initial state Q3Q2Q1Q0=0011? (D3 and Q3 are MSB,
    14·1 answer
  • A bicycle combination lock has four rings with numbers 0 through 9. Given the actual numbers and the combination to unlock, prin
    13·1 answer
  • Question 16 of 20
    12·2 answers
  • How to buy free big money computers that earn free money everydays?
    15·1 answer
  • A motorist is using the AHP to choose a new car from three possible models Arrow, a Bestmobile and a Commuter. The choice will a
    15·2 answers
  • Secondary hard drive whats its purpose
    5·1 answer
  • Give an idea of a law u would like to create
    5·2 answers
  • Write a pseudocode for the logic of a program that accepts five numbers from a user and displays one of the following messages:-
    8·1 answer
  • For computer forensics, ____________ is the task of collecting digital evidence from electronic media.
    5·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!