hi i am really stuck now i hope someone can help
ok so i have read in a file i have created a dictionary which reads every line and counts how many matches there are

compare={}
for matching in line:
matched =( matching[3],matching[7])

compare[matched]=0
else:
compared[matched]+=1


ok so thats my dictionary formed and if i print it i will get my keys and values which tell me how many i have for each combination


now for each combination i must randomly priint 15 lines?
im using random.sample(xrange(compare[matched]),15)
function but my question is how do i lionk my dctionary values to my lines so when i apply this fuction it would randomly print my lines from each [matched] combination

im very stuck please help and sorry for the broken up message and the mis=aligned script

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.