Q:

How to combine more than one list into more than one dicts by using python?

Sorry that I have to ask this question if it's a rather easy one, as time's limited for this script..I've already written some codes like below:
localNames = re.findall(r"<\*\[local-name\(\)='.*?'.*?\/@\*\[name\(\)='.*?'.*?'\]", str(nontransTagsContent[0]))
for i in localNames:
tags = re.findall(r"local-name\(\)='(.*?)'", i)
attributes = re.findall(r"name\(\)='(.*?)'", i)

And the result for print(tags) is below:
['tag1']
['tag2', 'tag3', 'tag4']
['tag5', 'tag6']

The result for print(attributes) is below:
['attribute1', 'attribute2', 'attribute3', 'attribute4']
['attribute5', 'attribute6']
['attribute7', 'attribute8', 'attribute9']

The result I want to get is dictionaries like:
{'tag1':['attribute1', 'attribute2', 'attribute3','attribute4'}
{'tag2':['attribute5', 'attribute6']}
{'tag3':['attribute5', 'attribute6']}
{'tag4':['attribute5', 'attribute6']}
{'tag5':['attribute7', 'attribute8', 'attribute9']}
{'tag6':['attribute7', 'attribute8', 'attribute9']}

I thought in this way, I can manipulate the data easily as I can extract data and write them into other forms. Below is the code I tried:
for x in tags:
    dict = zip(tags, attributes)
    print (list(dict))

But the output doesn't seem to be right. Would you help take a look at it and see how to fix this...Thank you very much!

A:

tags=[ 
    ['tag1'],
    ['tag2', 'tag3', 'tag4'],
    ['tag5', 'tag6'],
  ]

  attributes=[
              ['attribute1', 'attribute2', 'attribute3', 'attribute4'],
              ['attribute5', 'attribute6'],
              ['attribute7', 'attribute8', 'attribute9'],
            ]

  for idx, tag_line in enumerate(tags):
    for tag in tag_line:
      print {tag : attributes[idx]}

output:
{'tag1': ['attribute1', 'attribute2', 'attribute3', 'attribute4']}
{'tag2': ['attribute5', 'attribute6']}
{'tag3': ['attribute5', 'attribute6']}
{'tag4': ['attribute5', 'attribute6']}
{'tag5': ['attribute7', 'attribute8', 'attribute9']}
{'tag6': ['attribute7', 'attribute8', 'attribute9']}

if you want the dict has all the tag in one list
  from itertools import repeat
  for tag, attr in zip(tags,attributes):
    print dict(zip(tag, repeat(attr,len(tag))))

output:
{'tag1': ['attribute1', 'attribute2', 'attribute3', 'attribute4']}
{'tag4': ['attribute5', 'attribute6'], 'tag2': ['attribute5', 'attribute6'], 'tag3': ['attribute5', 'attribute6']}
{'tag5': ['attribute7', 'attribute8', 'attribute9'], 'tag6': ['attribute7', 'attribute8', 'attribute9']}

additional request:
tags, attributes = [], []
for i in localNames:
  tags.append(re.findall(r"local-name\(\)='(.*?)'", i))
  attributes.append(re.findall(r"name\(\)='(.*?)'", i))

