August's CompTIA IT Fundamentals course includes 19 hours of basic computer principle modules and prepares you for the certification exam. It's free for Premium Members, Team Accounts, and Qualified Experts!
yields some indecipherable second element of each tuple. What I want to get back from that is:
import itertools as itr In : list(itr.groupby('1222311')) Out: [('1', <itertools._grouper at 0x3cae048>), ('2', <itertools._grouper at 0x3cae630>), ('3', <itertools._grouper at 0x3caedd8>), ('1', <itertools._grouper at 0x3cae1d0>)]
though the order of elements within the tuples is irrelevant.
[('1', 1), ('2', 3), ('3', 1), ('1', 2)]
Add your voice to the tech community where 5M+ people just like you are talking about what matters.
Join the community of 500,000 technology professionals and ask your questions.