Search
 
SCRIPT & CODE EXAMPLE
 

PYTHON

# convert dictionary keys to a list

#Convert a dictionary keys to a list:
d3 = {'apple': 1, 'oranges': 2, 'bananas': 3, 'grapes': 4, 'strawberries': 5, 'watermelon': 6}
list(d3.keys())

['apple', 'oranges', 'bananas', 'grapes', 'strawberries', 'watermelon']

d3 = {'apple': 1, 'oranges': 2, 'bananas': 3, 'grapes': 4, 'strawberries': 5, 'watermelon': 6}
list(d3.values())

[1, 2, 3, 4, 5, 6]
Comment

PREVIOUS NEXT
Code Example
Python :: # remove sensitive information like name, email, phone no from text 
Python :: lambda to redshift python 
Python :: instance variables python 
Python :: python restrict function parameter type 
Python :: Python PEP (class) 
Python :: green book résumé 
Python :: how to initialize a token spacy python 
Python :: LCS Problem Python 
Python :: login to sso.accounts.dowjones.com for wsj.com "python" 
Python :: list of class instances in python 
Python :: finding-the-largest-three-digits-number-within-a-number 
Python :: qmenu 
Python :: function multiply(a b) 
Python :: python re return index of match 
Python :: python if corto 
Python :: Flask application displaying list of items from SQL database as text 
Python :: Redirecting an old URL to a new one with Flask micro-framework 
Python :: python QFileDialog select files 
Python :: python static 
Python :: ring For in Loop 
Python :: while loop using increment 
Python :: vue django delimiters 
Python :: importing cosine from scipy 
Python :: weigted average in pandas 
Python :: python strip txt 
Python :: screen.blit() arguments 
Python :: object creation using class constructor 
Python :: dynamo python templete path 
Python :: reverse row order padnas 
Python :: calling function whose name is in a variable 
ADD CONTENT
Topic
Content
Source link
Name
8+8 =