1.列表 # Filename: using_list.py # This is my shopping list shoplist=["apple", "mango", "carrot", "banana"] print ("I have", len(shoplist), "items to purchase.") print ("These items are:"
如何将xml转为python中的字典 import cElementTree as ElementTree class XmlListConfig(list): def __init__(self, aList): for element in aList: if element: # treat like dict if len(element) == 1 or element[0].tag != element[1].tag: self.append(XmlDictConfig(elemen