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

 

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

Make a dictionary of integers and their squares from 0 to maxValue (excluding maxValue) maxValue is at least 1.
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.


squareDictionary(1) → [{0: 0}]
squareDictionary(2) → [{0: 0, 1: 1}]
squareDictionary(3) → [{0: 0, 1: 1, 2: 4}]

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

def squareDictionary(maxValue):

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