Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Python by (50.2k points)
Can anyone tell me how to create a dictionary in Python?

1 Answer

0 votes
by (108k points)

For creating a simple dictionary in Python, you can use the code given below:

thedict = {

  "name": "Tom",

  "lastname": "Ford",

  "year": 1964

}

print(thedict)

The output:

{'name': 'Tom', 'lastname': 'Ford', 'year': 1964}

If you are looking for an online course to learn Python, I recommend this Python Certification program by Intellipaat.

Related questions

0 votes
1 answer
0 votes
1 answer
0 votes
4 answers

Browse Categories

...