Q:

Write a Python program to get the items from a given list with specific condition

0

Write a Python program to get the items from a given list with specific condition.

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

def first_index(l1):
    return sum(1 for i in l1 if (i> 45 and i % 2 == 0))

nums = [12,45,23,67,78,90,45,32,100,76,38,62,73,29,83]
print("Original list:")
print(nums)
n = 45
print("\nNumber of Items of the said list which are even and greater than",n)
print(first_index(nums))

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now