next() raises a StopIteration exception tellint the for loop to terminate : next « Buildin Function « Python






next() raises a StopIteration exception tellint the for loop to terminate

next() raises a StopIteration exception tellint the for loop to terminate


s = 'abcdef'
it = iter(s)
it

print it.next()

print it.next()

print it.next()

print it.next()


           
       








Related examples in the same category

1.iter: Iterator Types iter: Iterator Types