id/email
password
forgot password | create account
about | help | code help+videos | done | prefs
CodingBat code practice

 

konstans@stuy.edu > combineLists
prev  |  next  |  chance

Given lists of keys and values, combine them into a dictionary. The index determines which key matches which value, and both lists are always the same size, but could be empty. Keys are always unique.
WARNING Codingbat has issues with formatting so you have to return a list with your dictionary inside of it. You must return [D] where D is your dictionary.


combineLists([], []) → [{}]
combineLists([10], [40]) → [{10: 40}]
combineLists([64, 50], [9, 61]) → [{64: 9, 50: 61}]

...Save, Compile, Run (ctrl-enter)

def combineLists(keys,values):

Editor font size %:
Shorter output


Forget It! -- delete my code for this problem

Progress graphs:
 Your progress graph for this problem
 Random user progress graph for this problem
 Random Epic Progress Graph

Python Help

Copyright Nick Parlante 2017 - privacy