Skip to content

Instantly share code, notes, and snippets.

@IndhumathyChelliah
Last active Jul 23, 2020
Embed
What would you like to do?
#Strings
a="Welcome to Python"
#Converting string(iterable) to iterator using iter() function
b=iter(a)
print (b)#Output:<str_iterator object at 0x0084E658>
print (type(b))#Output:<class 'str_iterator'>
#Applying next() over the iterator.
#Returns one element at a time.
print (next(b))#Output:w
print (next(b))#Output:e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment