1def no_it_isnt(list):
2 for index, value in enumerate(list):
3 if isinstance(value, str):
4 list[index] = value[::-1]
5 elif isinstance(value, bool):
6 list[index] = not value
7 elif isinstance(value, (int, float)):
8 list[index] = -1 * value
9 return list[::-1]
10print(no_it_isnt([1, -3.14, True,'abc', 0]))
[0, 'cba', False, 3.14, -1]
.....
----------------------------------------------------------------------
Ran 5 tests in 0.000s
OK
19.10.2023 09:10