Causing errors

Report a typo

Python shell is great when we want to check something. Plus, it's absolutely safe to get Errors in shell because they won't affect your code. So, let's initialize a list:

my_list = [1, 2, 3]

and try to perform some operations on it in shell.

Which Errors does each line cause?

Match the items from left and right columns
import my_list
my_list.add(4)
new_list = my_list + 4
new_list[3]
my_list[3]
AttributeError
NameError
IndexError
ModuleNotFoundError
TypeError
___

Create a free account to access the full topic