Python 3.7:
from random import randrange
Arr = [randrange(-15,30) for i in range(20)]
print(Arr)
Arr = list(filter(lambda x: x%2!=0 and x>14,Arr))
print(sum(Arr))
Copyright © 2024 SCHOLAR.TIPS - All rights reserved.
Answers & Comments
Python 3.7:
from random import randrange
Arr = [randrange(-15,30) for i in range(20)]
print(Arr)
Arr = list(filter(lambda x: x%2!=0 and x>14,Arr))
print(Arr)
print(sum(Arr))