-1

I'm going through Zed Shaw's Learn Python The Hard Way textbook (LPTHW).

When Zed creates dictionaries he is using second bracket to create them. Such as:

# Creating an empty dictionary
dict = []

Here is a picture example where he used a dictionary to create a setup file for a project, using second brackets to create a dictionary called 'config':

link : implementation of dictionary from his workbook

But this is giving me an error. How do I solve it?

azizbro
  • 3,069
  • 4
  • 22
  • 36

1 Answers1

1

I've figured it out. For some weird reason, Zed uses second brackets to create dictionaries BUT you should be using curly brackets. Hope this helps everyone else!

# Creating an empty dictionary
config = {}
Jean-François Fabre
  • 137,073
  • 23
  • 153
  • 219
azizbro
  • 3,069
  • 4
  • 22
  • 36