1def no_it_isnt(elements):
2 result = []
3
4 for element in elements:
5 if type(element) is bool:
6 result.append(not element)
7 elif type(element) is str:
8 result.append(element[::-1])
9 else:
10 result.append(-1 * element)
11
12 return result[::-1]
.....
----------------------------------------------------------------------
Ran 5 tests in 0.000s
OK
n | 1 | def no_it_isnt(list): | n | 1 | def no_it_isnt(elements): |
2 | for index in range(len(list)): | 2 | result = [] | ||
3 | if type(list[index]) is bool: | 3 | |||
4 | list[index] = not list[index] | 4 | for element in elements: | ||
5 | elif type(list[index]) is str: | 5 | if type(element) is bool: | ||
6 | list[index] = list[index][::-1] | 6 | result.append(not element) | ||
7 | elif type(element) is str: | ||||
8 | result.append(element[::-1]) | ||||
7 | else: | 9 | else: | ||
n | 8 | list[index] *= -1 | n | 10 | result.append(-1 * element) |
9 | |||||
10 | list = list[::-1] | ||||
11 | 11 | ||||
t | 12 | return list | t | 12 | return result[::-1] |
Legends | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
|