0

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])

1
Contributor
1
Reply
2
Views
7 Years
Discussion Span
Last Post by sab786
0

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

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.