1def no_it_isnt(input_list):
2 result = []
3 for value in input_list[::-1]:
4 if type(value) == int:
5 result.append(value*-1)
6 elif type(value) == float:
7 result.append(value*-1)
8 elif type(value) == bool:
9 result.append(not value)
10 else:
11 result.append(value[::-1])
12
13 return result
.....
----------------------------------------------------------------------
Ran 5 tests in 0.000s
OK
n | 1 | def no_it_isnt(list): | n | 1 | def no_it_isnt(input_list): |
2 | result = [] | 2 | result = [] | ||
n | 3 | for value in list[::-1]: | n | 3 | for value in input_list[::-1]: |
4 | if type(value) == int: | 4 | if type(value) == int: | ||
n | 5 | result.append(value*(-1)) | n | 5 | result.append(value*-1) |
6 | elif type(value) == float: | 6 | elif type(value) == float: | ||
t | 7 | result.append(value*(-1)) | t | 7 | result.append(value*-1) |
8 | elif type(value) == bool: | 8 | elif type(value) == bool: | ||
9 | result.append(not value) | 9 | result.append(not value) | ||
10 | else: | 10 | else: | ||
11 | result.append(value[::-1]) | 11 | result.append(value[::-1]) | ||
12 | 12 | ||||
13 | return result | 13 | return result |
Legends | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
|