Get all the keys

in the lesson Get All Keys, we are given this code as an example

for student in test_scores.keys():
  print(student)

when i try something

for users in user_ids.key():
  print(users)

I get this error
for users in user_ids.key():
AttributeError: ‘dict’ object has no attribute ‘key’

i see that the answer for this exercise is

users = user_ids.keys()

I’m not sure if i’m missing something here. why does the example given in this section not work? Or what am i doing wrong?

you made a typo? you wrote key, it should be keys

that the name of this function is plural make sense, you are very likely to get multiple keys.

1 Like

Thank you for pointing that out