1def no_it_isnt(args):
2 res = []
3 for arg in args:
4 if isinstance(arg, bool):
5 res.append(not arg)
6 elif isinstance(arg, str):
7 res.append(arg[::-1])
8 else:
9 res.append(-arg)
10 return res[::-1]
.....
----------------------------------------------------------------------
Ran 5 tests in 0.000s
OK
| f | 1 | f | 1 | ||
| 2 | def no_it_isnt(args): | 2 | def no_it_isnt(args): | ||
| n | 3 | res=[] | n | 3 | res = [] |
| 4 | for arg in args: | 4 | for arg in args: | ||
| 5 | if isinstance(arg, bool): | 5 | if isinstance(arg, bool): | ||
| t | 6 | res.append( not arg ) | t | 6 | res.append(not arg) |
| 7 | elif isinstance(arg, str): | 7 | elif isinstance(arg, str): | ||
| 8 | res.append(arg[::-1]) | 8 | res.append(arg[::-1]) | ||
| 9 | else: | 9 | else: | ||
| 10 | res.append(-arg) | 10 | res.append(-arg) | ||
| 11 | return res[::-1] | 11 | return res[::-1] | ||
| 12 | 12 |
| Legends | ||||||||||
|---|---|---|---|---|---|---|---|---|---|---|
|
| |||||||||