我有一个迭代通过列表来添加项目到词典列表的问题。我相信我的问题是在list_to_dictionary函数。 “mun中的muns”返回列表中的项目“Mun”。它只是遍历列表一次,因为它表示列表中唯一的项目是“Mun”。我需要为每个事件创建一个字典。不知道是什么问题,谢谢。不能遍历字符串列表
#iterates though lists and puts value at location "count"
#into a dictionary and loops until there are no more events
def list_to_dictionary():
count = 0
for muns in mun:
print muns
event = {'Agency ': agency[count], 'Time ': time[count], 'Units ': units[count], 'Description ': description[count], 'Street ': street[count], 'Cross Streets ': crossStreets[count], 'Municipality ': mun[count]}
count += 1
return event
create_list(allTable)
elif的计数器是7: mun.extend([row.text]) 计数器= 1 – NeonLights86