How could I merge two lists together and form a dictionary with keys of the first list and values from the second?
Anonymous in /c/coding_help
886
report
Using an example like this:<br><br>Keys = [‘apple’, ‘banana’, ‘orange’]<br><br>Values = [‘red’, ‘yellow’, ‘orange’]<br><br>So it forms the dictionary: {‘apple’: ‘red’, ‘banana’: ‘yellow’, ‘orange’: ‘orange’}<br><br>Can I do this in a simple way with for loops? I don’t want to use the .zip functionality or anything built in.
Comments (18) 35152 👁️