About 45,400 results
Open links in new tab
  1. Creating a new dictionary in Python - Stack Overflow

    Feb 4, 2020 · I want to build a dictionary in Python. However, all the examples that I see are instantiating a dictionary from a list, etc . .. How do I create a new empty dictionary in Python?

  2. dictionary - How to initialize a dict with keys from a list and empty ...

    How to initialize a dict with keys from a list and empty value in Python? Asked 15 years, 10 months ago Modified 2 years, 10 months ago Viewed 531k times

  3. How to set the python type hinting for a dictionary variable?

    Oct 1, 2018 · How to set the python type hinting for a dictionary variable? Asked 7 years, 2 months ago Modified 1 year, 6 months ago Viewed 182k times

  4. How do you create nested dict in Python? - Stack Overflow

    May 2, 2013 · I want my Python code to open both files and for each Device_Name in the Data file, map its GDN, Device_Type, and Device_OS value from the Mapping file. I know how to …

  5. What's the best way to initialize a dict of dicts in Python?

    What's the best way to initialize a dict of dicts in Python? [duplicate] Asked 16 years, 8 months ago Modified 9 years, 9 months ago Viewed 115k times

  6. Python creating a dictionary of lists - Stack Overflow

    Python creating a dictionary of lists Asked 16 years, 6 months ago Modified 2 years, 9 months ago Viewed 636k times

  7. What is the proper way to format a multi-line dict in Python?

    227 In Python, I want to write a multi-line dict in my code. There are a couple of ways one could format it. Here are a few that I could think of:

  8. Difference between dict and set (python) - Stack Overflow

    Dec 19, 2015 · The syntax {1, 2, 3} for sets was introduced with Python 2.7. Since {} has been used for such a long time it will stay as the way to define an empty dictionary. If Python would …

  9. Initializing a dictionary in python with a key value and no ...

    137 Use the fromkeys function to initialize a dictionary with any default value. In your case, you will initialize with None since you don't have a default value in mind.

  10. How do I initialize a dictionary of empty lists in Python?

    My attempt to programmatically create a dictionary of lists is failing to allow me to individually address dictionary keys. Whenever I create the dictionary of lists and try to append to one key, …