Code Yarns ‍👨‍💻
Tech BlogPersonal Blog

Python: Keys & values of dictionaries

📅 2009-Oct-13 ⬩ ✍️ Ashwin Nanjappa ⬩ 📚 Archive

adict = {3:"three", 5:"five", 0:"zero"} klist = list(adict.keys())      # [0, 3, 5] vlist = list(adict.values())    # ['zero', 'three', 'five']