+ 1

What is a Key?

whats is the difference between a key and a string ? Please provide me with a definition of each.

10th Dec 2016, 9:34 AM
Kamvalethu Rengqe
Kamvalethu Rengqe - avatar
6 Answers
+ 7
key opens doors. string holds key so you don't lose it.
10th Dec 2016, 9:46 AM
Ahri Fox
Ahri Fox - avatar
+ 5
A string is a set of characters. It can be used as a key. A key is a way of labelling and selecting a value in a dictionary, so you can retrieve it by that name rather than an index value.
10th Dec 2016, 9:40 AM
Kerrash
Kerrash - avatar
+ 1
the key is an identifier for your data un the dict. the key is generaly a string (ie a simple word) or can be an int or an object too. in a list, you access the data by an index, un a dict, you access by the key
10th Dec 2016, 9:39 AM
David Pierret
David Pierret - avatar
+ 1
A String is a set of values (int, char , whatever...) with an index work as pointer and start from 0 pointing to the first element and continue till the last one. A Dictionary is a new style of a string with a chance to rename the index by values (int, char , whatever...) and called key, and giving you more option in the value portion that you can use even a string.
14th Dec 2016, 5:55 AM
Mohamed Abdelmoniem
Mohamed Abdelmoniem - avatar
0
A key is a python object ( str, int...) it must be immutable (can't be changed). in dictionary, we associate keys to values (values are python objects but here the immutability is not a requirement ) so we access those values using the keys associated to them
15th Dec 2016, 5:28 PM
zak
0
the Bird IS a key
25th Dec 2016, 2:01 AM
Die