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

 

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

Create a dictionary from a list such that the keys are the values in the list, and the associated values are the indices of the respective values. Assume all of the values in the list are 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.


reverseList([]) → [{}]
reverseList([6]) → [{6: 0}]
reverseList([55, 89]) → [{55: 0, 89: 1}]

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

def reverseList(nums):

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