-
-
Save IndhumathyChelliah/c39ce37add52680d94945bcda195761a to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Using filter function | |
evennumber=filter(lambda x: x%2==0,range(1,11)) | |
#filter() returns an iterator. | |
print (evennumber) #Output:<filter object at 0x0144EC10> | |
#Iterating through iterator using for loop | |
for i in evennumber: | |
print (i,end=" ") | |
#Output:2 4 6 8 10 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment