Skip to content

Instantly share code, notes, and snippets.

@BetterProgramming
Created January 18, 2021 16:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save BetterProgramming/7ff050ce032c662f0c09e4db3a0344fe to your computer and use it in GitHub Desktop.
Save BetterProgramming/7ff050ce032c662f0c09e4db3a0344fe to your computer and use it in GitHub Desktop.
def even(x):
if x%2==0:
return True
num1=[1,2,3,4,5,6,7,8,9,10]
result=filter(even,num1)
print (result)#Output:<filter object at 0x00E5E4D8>
print (next(result))
#Output: 2
print (next(result))
#Output: 4
print (next(result))
#Output: 6
print (next(result))
#Output: 8
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment