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
notsponge [240]
2 years ago
8

8.11 LAB: Filter and sort a list

Computers and Technology
1 answer:
Helen [10]2 years ago
6 0

nums = input("Enter your numbers: ")

lst = nums.split()

new_lst = ([])

for i in lst:

   if int(i) >= 0:

       new_lst.append(int(i))

new_lst.sort()

for x in new_lst:

   print(x, end=" ")

The above code is in case the user enters the numbers.

def func(lst):

   lst.sort()

   for i in lst:

       if i >=0:

           print(i, end=" ")

lst = ([10,-7, 4, 39, -6, 12, 2])

func(lst)

The above code is in case you must input the numbers manually via a function.

I hope this helps!

You might be interested in
Match the job roles with their appropriate qualifications. business analyst multimedia artist network and computer systems admin
Tanya [424]

Answer:

business analyst:  degree in business administration arrowRight  

multimedia artist : training in 2D and 3D modeling arrowRight​

network and computer systems administrator: master's course in management information systems arrowRight  

software quality assurance engineer: knowledge of the software lifecycle process arrowRight  

Explanation:

Please check the answer section

6 0
2 years ago
Read 2 more answers
A technician is troubleshooting a small network with cable Internet service in which a user is receiving a message in her web br
expeople1 [14]

Answer:

Option E is correct.

Explanation:

A professional is fixing a cable internet access network by which a person in their internet browser receives a text saying that a link could not be reached. It would be known that each and every server along the network is having the individual problem across whole websites when interviewing a person.

So, connect the system to the wired connection directly, & try to access the internet for troubleshooting the following issue.

6 0
3 years ago
On line two, you take a string, word, as input. Then, using that string...
Solnce55 [7]

Answer:

7

Explanation:

This one obtains results that the others in particular do not have, whether it is even one more word or another initial sentence

8 0
2 years ago
OH NO THE HEAVY IS DEAD
Anarel [89]

Answer:

what does that mean?

are you okay?

Did something happen?

4 0
3 years ago
Read 2 more answers
Sharon is a skilled professional who operates logging equipment.
Viktor [21]
Natural resource systems hope this helps

7 0
2 years ago
Read 2 more answers
Other questions:
  • Write a script that creates a user-defined database role named OrderEntry in the MyGuitarShop database. Give INSERT and UPDATE p
    8·1 answer
  • ‘The increased availability of mobile digital devices has had a positive impact on how young people use their free time’. Make a
    14·2 answers
  • Why is it that even though there aren't the max number of answers on a question, (or sometimes even NO answers) When I click the
    11·1 answer
  • Which three of the following are used for mobile Internet access?
    12·2 answers
  • What type of lights are necessary for silhouettes?
    12·2 answers
  • Relation between training and occupation with examples in points . Plz tell fast<br> ​
    5·1 answer
  • Which can be used to decode a Unicode character encoding into text?
    13·1 answer
  • A driver that approaches a controlled intersection with a signal that is not working must:
    12·1 answer
  • Virus program do not replicate themselves true or false one word answer only​
    15·2 answers
  • What is the HTML tag used to define a block of content?<br> O <br> O class<br> O #id<br> O
    8·2 answers
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!