Lesson 62

This commit is contained in:
David Avery 2020-02-03 13:46:01 +00:00
parent b853d90f21
commit 86c7332cd4

View File

@ -1,4 +1,4 @@
def positive(numbers): def positive(numbers):
return([positive for positive in numbers if positive > 0]) return([positive if positive > 0 else 0 for positive in numbers])
print(positive([-5, 3, -1, 101])) print(positive([-5, 3, -1, 101]))