What is a dictionary in Python?

0 votes
Can someone help me with Dictionary in Python? I am new to Python and finding dictionary complicated to understand. Please help.
Mar 4, 2019 in Python by Trisha
67 views

1 answer to this question.

0 votes

Dictionary can be understood as a key-value pair stored together.

dict = {'Name': 'Priyaj', 'Age': 22, 'College': 'TICT'}
print "dict['Name']: ", dict['Name']
print "dict['Age']: ", dict['Age']

Output:

dict[Name]: Priyaj
dict[Age]: 22

This way you can use a dictionary. Hope this helps.

answered Mar 4, 2019 by Priyaj
• 57,700 points

Related Questions In Python

+1 vote
5 answers
0 votes
1 answer

What is a “method” in Python?

It's a function which is a member ...READ MORE

answered Oct 23, 2018 in Python by SDeb
• 13,250 points
122 views
0 votes
1 answer

What is the process to kill a particular thread in python?

A multiprocessing.Process can p.terminate() In the cases where I want to ...READ MORE

answered Feb 4, 2019 in Python by charlie_brown
• 7,780 points
2,401 views
0 votes
0 answers

what is a name error in python?

why am i getting a name error ...READ MORE

Mar 7, 2019 in Python by anonymous
450 views
+1 vote
2 answers

how can i count the items in a list?

Syntax :            list. count(value) Code: colors = ['red', 'green', ...READ MORE

answered Jul 6, 2019 in Python by Neha
• 330 points

edited Jul 8, 2019 by Kalgi 1,564 views
0 votes
0 answers
+4 votes
6 answers

Lowercase in Python

You can simply the built-in function in ...READ MORE

answered Apr 11, 2018 in Python by hemant
• 5,800 points
1,186 views
0 votes
1 answer

What is the meaning of “int(a[::-1])” in Python?

Assumming a is a string. The Slice ...READ MORE

answered Aug 27, 2018 in Python by Priyaj
• 57,700 points
262 views
0 votes
4 answers

What is a Tuple in Python and how to use it?

Tuples  are a  Unchanging sequence of values, ...READ MORE

answered Jun 21 in Python by sahil
• 540 points
480 views