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]
3 years ago
8

8.11 LAB: Filter and sort a list

Computers and Technology
1 answer:
Helen [10]3 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
Elena is used to kissing her friends on both cheeks as a form of greeting in her native country. She notices that her new friend
Veseljchak [2.6K]

Answer:

c. Norms.

Explanation:

When Elena noticed her friend getting uncomfortable when she kisses him on the cheeks as a form of greeting she was violating his norms.

Norms are something that is standard or typical.

In USA there they not used to kiss on the cheeks to greet their friends there would be some other norm of greeting someone.

5 0
4 years ago
Nicole is in a study group to prepare for a test on plant biology, a subject she knows a lot about. During their meetings, she a
Anestetic [448]

Answer:

b

Explanation:

i pretty sure it b , yep it is b

4 0
3 years ago
Read 2 more answers
In which of the following situations would you want to use a word processing template?
creativ13 [48]
<h2>Answer:</h2>

<u>The correct answer is A. </u><u>You need to write a letter to a company you’d like to work with, and have specific questions to ask.</u>

<h2>Explanation:</h2>

Applying for a job is a very formal type of document which contains all the required and necessary information about a person who wants to apply. So a letter is typed in Microsoft word format to keep the document aligned and beautiful. Word template can make it professional which otherwise becomes hard to apply for a job in the absence of quality editing.

5 0
3 years ago
Read 2 more answers
Hi what is full form of ugst​
AURORKA [14]

Answer:

UGST – Union Territory Goods & Services Tax.

4 0
3 years ago
Read 2 more answers
Function of network security​
myrzilka [38]

Answer:ffffffffffffgggggg

Explanation:vvvc

5 0
4 years ago
Other questions:
  • An author is preparing to send their book to a publisher as an email attachment. The file on their computer is 1000 bytes. When
    6·1 answer
  • A ____ can interpret physical addressing information.
    11·1 answer
  • list the network characteristics of the wireless network(s) in the decode -- SSIDs, channels used, AP names, presence of Bluetoo
    6·1 answer
  • Write the definition of a function half , which receives an integer parameter and returns an integer that is half the value of t
    7·1 answer
  • Your program will demonstrate use of arrays, searching an array, using methods, passing parameters by reference, returning value
    13·1 answer
  • Write an expression that executes the loop while the user enters a number greater than or equal to 0.
    10·1 answer
  • What to do if your monitor is not displaying a picture
    12·1 answer
  • Which of the following statements holds true for the term plug-in? Group of answer choices It refers to a program (typically a m
    11·1 answer
  • _____ provides the best video resolution. *<br><br> VGA<br> HDMI<br> USB<br> DVI
    7·1 answer
  • 1. Encrypt this binary string into cipher text: 110000. Include in your answer the formula the
    10·1 answer
Add answer
Login
Not registered? Fast signup
Signup
Login Signup
Ask question!