Dapatkan Iterator Berikutnya Tanpa Menambah Python
from more_itertools import peekable
p = peekable(['a', 'b'])
p.peek()
# 'a'
next(p)
# 'a'
p.peek()
# 'b'
CodeHunter
from more_itertools import peekable
p = peekable(['a', 'b'])
p.peek()
# 'a'
next(p)
# 'a'
p.peek()
# 'b'