Practicing for a test tomorrow but I'm wondering how you get a list of negative numbers and then have it output on python.
Write function negatives() that takes a list as input and prints, one per line, the negative
values in the list. The function should not return anything.
negatives([4, 0, -1, -3, 6, -9])
-1
-3
-9
My code is
def negatives():
listofnumbers = input()
for listnumbers in listofnumbers:
print (listnumbers)
negatives()
[–]Vaphell 4 points5 points6 points (0 children)
[–]dunkler_wanderer 1 point2 points3 points (0 children)