Question: def check _ numbers ( lst ) : c = 0 for num in lst: if num % 2 = = 0 : c +

def check_numbers(lst):
c=0
for num in lst:
if num %2==0 :
c +=1
else:
c -=1
if c>0 :
return "More evens"
elif c==0 :
return "Equal evens and odds"
else:
return "More odds"
result = check_numbers ([4,5,6,7,8])
print(result)
What will be the result according to the code above?
 def check_numbers(lst): c=0 for num in lst: if num %2==0 :

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!