Answers for "how to add keys in a dictionary with a for loop in python"

2

python loop append to dictionary

case_list = []
for entry in entries_list:
    case = {'key1': entry[0], 'key2': entry[1], 'key3':entry[2] }
    case_list.append(case)
Posted by: Guest on December-04-2020

Code answers related to "how to add keys in a dictionary with a for loop in python"

Python Answers by Framework

Browse Popular Code Answers by Language