1def no_it_isnt(argument):
2 result = []
3 for element in argument:
4 if type(element) is str:
5 result.append(element[::-1])
6 elif type(element) is bool:
7 result.append(not element)
8 elif type(element) in (int, float):
9 result.append(-1*element)
10 return result[::-1]
.....
----------------------------------------------------------------------
Ran 5 tests in 0.000s
OK
f | 1 | def no_it_isnt(argument): | f | 1 | def no_it_isnt(argument): |
2 | result = [] | 2 | result = [] | ||
3 | for element in argument: | 3 | for element in argument: | ||
4 | if type(element) is str: | 4 | if type(element) is str: | ||
t | 5 | result.insert(0, element[::-1]) | t | 5 | result.append(element[::-1]) |
6 | continue | ||||
7 | if type(element) is bool: | 6 | elif type(element) is bool: | ||
8 | result.insert(0, not element) | 7 | result.append(not element) | ||
9 | continue | ||||
10 | if type(element) is int or float: | 8 | elif type(element) in (int, float): | ||
11 | result.insert(0, -1*element) | 9 | result.append(-1*element) | ||
12 | return result | 10 | return result[::-1] |
Legends | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
|