I’m new to python so I really don’t know the language very well.
the following example was taken from here http://docs.python.org/library/json.html
>>> import json
>>> json.loads('["foo", {"bar":["baz", null, 1.0, 2]}]')
[u'foo', {u'bar': [u'baz', None, 1.0, 2]}]
what does the u mean? and how do i know which elements are available in the dictionary?
Ignacio’s answer a bit more verbose (no upvotes to me)
u’something’ means that ‘something’ is a unicode string, and not for instance an ascii string. Generally text is encoded as 8-bit characters, and you need an encoding to properly interpret/display it. Unicode is 16-bit and doesn’t need seperate encodings for the various locale dependent characters.
In a dictionary (enclosed by {}) the key is the part before the “:” and the value comes after.
You got a list, with elements: