1def no_it_isnt(yes_it_is):
2 the_full_argument = []
3
4 for argument in yes_it_is[::-1]:
5 if type(argument) is int or type(argument) is float:
6 the_full_argument.append(-argument)
7 continue
8 if type(argument) is bool:
9 the_full_argument.append(not argument)
10 continue
11 if type(argument) is str:
12 the_full_argument.append(argument[::-1])
13
14 return the_full_argument
.....
----------------------------------------------------------------------
Ran 5 tests in 0.000s
OK
f | 1 | def no_it_isnt(yes_it_is): | f | 1 | def no_it_isnt(yes_it_is): |
2 | the_full_argument = [] | 2 | the_full_argument = [] | ||
t | t | 3 | |||
3 | for argument in yes_it_is[:: - 1]: | 4 | for argument in yes_it_is[::-1]: | ||
4 | match type(argument).__name__: | 5 | if type(argument) is int or type(argument) is float: | ||
5 | case int.__name__ | float.__name__: | ||||
6 | the_full_argument.append( - argument) | 6 | the_full_argument.append(-argument) | ||
7 | case bool.__name__: | 7 | continue | ||
8 | if type(argument) is bool: | ||||
8 | the_full_argument.append(not argument) | 9 | the_full_argument.append(not argument) | ||
9 | case str.__name__: | 10 | continue | ||
11 | if type(argument) is str: | ||||
10 | the_full_argument.append(argument[:: - 1]) | 12 | the_full_argument.append(argument[::-1]) | ||
13 | |||||
11 | return the_full_argument | 14 | return the_full_argument |
Legends | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
|
|
19.10.2023 09:02
19.10.2023 09:02