Hey! I have a home task that i cant do. I'm fairly new to python and this is quite difficult for me. Will appreciate any help:
If the function is called in the following way: print_list([1, '2', 3, '4']), then the output should be like this:
If the function is called in the following way: print_list([1, '2', 3, '4']), then the output should be like this:
Output:2
0
4
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 += 1From what I understand i need to use For loop
buran write Dec-07-2021, 09:29 AM:
Please, use proper tags when post code, traceback, output, etc. This time I have added tags for you.
See BBcode help for more info.
Please, use proper tags when post code, traceback, output, etc. This time I have added tags for you.
See BBcode help for more info.