Time to be wrong

Report a typo

The most effective way to learn to read traceback is to be wrong. Therefore, there are errors in the print_list() function below that you need to fix. After each fix, you can run the code and read the traceback to find a new error.

If the function is called in the following way: print_list([1, '2', 3, '4']), then the output should be like this:

2
0
4

You do NOT need to call a function in the code section. Just fix the code and bring it to working condition.

Write a program in Python 3
def print_list(some_list):

while i < range(len(some_list)):
if some_list[i] % 2 == 0:
print(some_list[i])
if some_list[i] % 3 = 0:
print(some_list[i] % 3)
i += 1
___

Create a free account to access the full topic