1def no_it_isnt(values):
2 new_values = []
3 values.reverse()
4 for elem in values:
5 if isinstance(elem, bool):
6 new_values.append(not elem)
7 elif isinstance(elem, (float, int)):
8 new_values.append(-elem)
9 elif isinstance(elem, str):
10 new_values.append(elem[::-1])
11 return new_values
.....
----------------------------------------------------------------------
Ran 5 tests in 0.000s
OK
f | 1 | def no_it_isnt(values): | f | 1 | def no_it_isnt(values): |
2 | new_values = [] | 2 | new_values = [] | ||
3 | values.reverse() | 3 | values.reverse() | ||
4 | for elem in values: | 4 | for elem in values: | ||
5 | if isinstance(elem, bool): | 5 | if isinstance(elem, bool): | ||
6 | new_values.append(not elem) | 6 | new_values.append(not elem) | ||
7 | elif isinstance(elem, (float, int)): | 7 | elif isinstance(elem, (float, int)): | ||
t | 8 | new_values.append(elem - (elem * 2)) | t | 8 | new_values.append(-elem) |
9 | elif isinstance(elem, str): | 9 | elif isinstance(elem, str): | ||
10 | new_values.append(elem[::-1]) | 10 | new_values.append(elem[::-1]) | ||
11 | return new_values | 11 | return new_values |
Legends | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
|
f | 1 | def no_it_isnt(values): | f | 1 | def no_it_isnt(values): |
2 | new_values = [] | 2 | new_values = [] | ||
3 | values.reverse() | 3 | values.reverse() | ||
4 | for elem in values: | 4 | for elem in values: | ||
t | 5 | if isinstance(elem, bool): | t | 5 | if isinstance(elem, bool): |
6 | new_values.append(not elem) | 6 | new_values.append(not elem) | ||
7 | elif isinstance(elem, (float, int)): | 7 | elif isinstance(elem, (float, int)): | ||
8 | new_values.append(elem - (elem * 2)) | 8 | new_values.append(elem - (elem * 2)) | ||
9 | elif isinstance(elem, str): | 9 | elif isinstance(elem, str): | ||
10 | new_values.append(elem[::-1]) | 10 | new_values.append(elem[::-1]) | ||
11 | return new_values | 11 | return new_values |
Legends | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
|