On Mit dem interaktiven Interpreter kann man so etwas experimentell untersuchen.
>>> xshow(None)
Traceback (most recent call last):
File "<pyshell#12>", line 1, in <module>
xshow(None)
File "<pyshell#11>", line 1, in xshow
def xshow(x): print("{[[[[]}".format(x))
TypeError: 'NoneType' object is not subscriptable
# So let us try something subscriptable.
>>> xshow([])
Traceback (most recent call last):
File "<pyshell#13>", line 1, in <module>
xshow([])
File "<pyshell#11>", line 1, in xshow
def xshow(x): print("{[[[[]}".format(x))
TypeError: list indices must be integers or slices, not str
# That did not work, try something else.
>>> xshow({})
Traceback (most recent call last):
File "<pyshell#14>", line 1, in <module>
xshow({})
File "<pyshell#11>", line 1, in xshow
def xshow(x): print("{[[[[]}".format(x))
KeyError: '[[['
# Aha! Try a dict with key '[[['.
>>> xshow({'[[[':1})
1
Jetzt lesen Sie vielleicht das Dokument.
Die im Titel und im Code verwendete Zeichenfolge ist unterschiedlich. Titel hat drei linke Klammern, Code hat vier ... –