Item[Key k] | Sololearn: Learn to code for FREE!
Новый курс! Каждый программист должен знать генеративный ИИ!
Попробуйте бесплатный урок
0

Item[Key k]

If you can put the key without the index, can you put the index without the key?

28th Jul 2020, 3:53 PM
ANNA TOWNSEND
ANNA TOWNSEND - avatar
3 ответов
+ 2
Are you talking about a dictionary? As a dictionary doesn't have an index per say... but a key and a value. ... I don't think I understand your question.
29th Jul 2020, 2:30 AM
laura
+ 2
ANNA TOWNSEND I'm not sure...without googling.... Have you tried it on a sorted list to have an index and no key... if a key is required my guess that compiler will complain.... hopefully someone else will also chime in that might know
29th Jul 2020, 5:23 PM
laura
0
It's a property in both dictionaries and sortedlists that displays the value by inputting its key. You can put in the index as well, so I was wondering if you could put in the index without the key sense you can put in the key without the index.
29th Jul 2020, 3:10 AM
ANNA TOWNSEND
ANNA TOWNSEND - avatar