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
27 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,140 points
20 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,160 points
19 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
• 1,610 points

edited Jun 26 by Kalgi 29 views
0 votes
0 answers

How do you convert a dictionary to a defaultdict?

What are the advantages of using a ...READ MORE

Jul 2 in Python by Waseem
• 3,560 points
16 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 135 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
13 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
15 views