Dictionaries in Python

As explained in the tutorial for dictionary Methods. The type for dictionary.keys() is not of type "list" but is of type "dict_keys". As explained in the tutorial it shows the type as list. Kindly check the attachment for more detail & Request you to do the changes for the same.

1reply Oldest first
  • Oldest first
  • Newest first
  • Active threads
  • Popular
  • Hi Punit ,

    That's a great catch! It looks like you're running Python 3, in which calling object.keys() returns a dict_keys object. Since notebooks in Mode currently run on Python 2, a list object is returned in the Notebook editor.

    Great news, though - we will be enabling Python 3 in our notebooks soon! We'll be sure to update this section of the tutorial when we do.


Like Follow
  • Status Answered
  • 1 yr agoLast active
  • 1Replies
  • 478Views
  • 3 Following