-
-
Save IndhumathyChelliah/f826769f94379f4af6127d58faf8d826 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
#set | |
a={1,2,3,4,5} | |
#Converting set(iterable) into iterator object using iter() function. | |
b=iter(a) | |
print (b)#Output:<set_iterator object at 0x029794E8> | |
print (type(b))#Output:<class 'set_iterator'> | |
#Applying next() over the iterator. | |
#Returns one element at a time | |
print (next(b))#Output:1 | |
print (next(b))#Output:2 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment