Convert dictionary keys to a list

0 votes
Is there a simply way to accomplish this? I need all the keys of a dictionary stored in a list.
Jun 28, 2018 in Python by nightshade
• 870 points
36 views

1 answer to this question.

0 votes
list.(dictionary.keys())
answered Jun 28, 2018 by Hamartia's Mask
• 1,580 points

Related Questions In Python

0 votes
1 answer

Convert the keys of a dictionary to list

Unpacking with * works with any object ...READ MORE

answered Feb 6 in Python by Omkar
• 67,620 points
28 views
0 votes
1 answer

Add new keys to a dictionary?

>>> d = {'key':'value'} >>> print(d) {'key': ...READ MORE

answered Aug 13, 2018 in Python by Priyaj
• 56,900 points
30 views
+1 vote
1 answer

How to convert records from csv to a list in Python?

If you are using Python 3.x then ...READ MORE

answered Jun 25 in Python by Arvind
• 2,960 points

edited Jun 26 by Kalgi 47 views
0 votes
1 answer

How do you convert a dictionary to a defaultdict?

from collections import defaultdict a = {1: 2, ...READ MORE

answered Aug 2 in Python by Mohammad
• 3,060 points
178 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 in Python by Neha
• 330 points

edited Jul 8 by Kalgi 277 views
+4 votes
6 answers
0 votes
1 answer

Combine list items to a string

>>> stmt = ['this','is','a','statement'] >>> ' '.join(sentence) 'this is ...READ MORE

answered Jun 7, 2018 in Python by Hamartia's Mask
• 1,580 points
20 views
0 votes
1 answer

Deleting a list element by value

Use the remove() function: >>> p = [1, ...READ MORE

answered May 11, 2018 in Python by Hamartia's Mask
• 1,580 points
20 views