Try it on paper first. A hint, the key idea and the worked solution are here when you need them.
Give the name of the error for each line: int("12x"), 5 / 0, [1, 2][9], {}["k"], 3 + "a" and zzz (a name that was never made).
The error name says what kind of mistake it is.
Have you tried it?
Work it out on paper first. It is fine to get stuck or make a mistake: that is how we learn. When you are ready, compare your working with the solution.
int("12x"): the text has a wrong content: ValueError.5 / 0: ZeroDivisionError.[1, 2][9]: the list has no position 9: IndexError.{}["k"]: the dictionary has no key "k": KeyError.3 + "a": a number and a text cannot be added: TypeError.zzz: the name was never made: NameError.Log in to join the discussion.
Loading…