Answers for "get next iterator without incrementing python"

0

get next iterator without incrementing python

from more_itertools import peekable

p = peekable(['a', 'b'])
p.peek()
# 'a'
next(p)
# 'a'
p.peek()
# 'b'
Posted by: Guest on May-19-2021

Python Answers by Framework

Browse Popular Code Answers by Language