Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- x = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, -11, -12, -13, -14, -15]
- y = [0, 2, 3, 0, 5, 6, 7, 8, 9, 10, -11, -12, -13, -14]
- z = [-1]
- r = [1]
- a = [0,0,0,0,0,0,0,0,0]
- from copy import *
- def count_positives_sum_negatives(arr):
- dub = copy(arr)
- out = []
- if not arr:
- return []
- if sum([z for z in dub if z >= 0]) == 0:
- return [0,0]
- else:
- calc1 = len([i for i in dub if i > 0])
- out.append(calc1)
- calc2 = sum([x for x in dub if x < 0])
- out.append(calc2)
- return out
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement