1def modify(element):
2 if type(element) is int or type(element) is float:
3 return -element
4 elif type(element) is bool:
5 return not element
6 else:
7 return element[::-1]
8
9
10def no_it_isnt(elements):
11 return [modify(i) for i in elements[::-1]]
12 ##return list(map(modify, elements))[::-1] is also valid
.....
----------------------------------------------------------------------
Ran 5 tests in 0.000s
OK
19.10.2023 08:58