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