Skip to content
  • Tutorials
    • c programming
      • libraries
    • c++
    • Linux
    • Python
    • batch programming
    • Technology
  • IDE
  • Tools
Python Ordered Dictionary 1

Python Ordered Dictionary

June 17, 2022 by Anurag batra
from collections import OrderedDict

# Remembers the order the keys are added!
x = OrderedDict(a=1, b=2, c=3)

Here is what the above code is Doing:
1. Create an empty OrderedDict.
2. Add the key-value pairs from the dict literal.
3. Return the OrderedDict.

Categories Python Examples
Post navigation
using bs4 to obtain html element by id
splitting a number into digits python
© MyEduKit - 2022 . All Rights Reserved.