0
Write a function called manipulate_data which will act as follows: When given a list of integers, return a list, where the fi
here is my code def manipulate_data(numbers): count=0 summation=0 for number in numbers: if number%2==0: count+=1 else: summation+=number numbers.append(count) numbers.append(summation) return numbers
1 Odpowiedź
+ 1
My psychic abilities allow me to understand what you want to do:
def manipulate_data(numbers):
count=0
summation=0
for number in numbers:
if number%2==0:
count+=1
else:
summation+=number
return [count, summation]