Answers for "how to get dict key in python"

1

python get keys and values from dict

# using dict.items() to
# get key and value
print ("Dict key-value are : ")
for key, value in test_dict.items():
    print (key, value)
Posted by: Guest on May-13-2021
1

convert dictionary keys to list python

newlist = list()
for i in newdict.keys():
    newlist.append(i)
Posted by: Guest on April-28-2020

Python Answers by Framework

Browse Popular Code Answers by Language