Mega Code Archive

 
Categories / Python / Buildin Function
 

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()