abhik1368
0
Newbie Poster
Recommended Answers
Jump to PostAnd here with itertools 'magic', as here seems to be time for present solutions:
from itertools import groupby # space separated data raw_data = '''DB01967 ZIPA DB01967 PFAZ DB01992 YVBK DB01992 ZAP70 DB02191 ZIPA DB02319 YQHD DB02552 ZFPP'''.splitlines() data_groups = groupby(raw_data, key = lambda x: x.split()[0]) for …
All 3 Replies
lrh9
95
Posting Whiz in Training
vegaseat
1,735
DaniWeb's Hypocrite
Team Colleague
TrustyTony
888
pyMod
Team Colleague
Featured Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.