Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

values

  • values

  • Values are returned in the same random order as the keys are.

user = {
   'fname': 'Foo',
   'lname': 'Bar',
   'workplace': 'Bar',
}

print(user)   # {'fname': 'Foo', 'lname': 'Bar', 'workplace': 'Bar'}

print(user.keys())    # dict_keys(['fname', 'lname', 'workplace'])

print(user.values())  # dict_values(['Foo', 'Bar', 'Bar'])