1def function_that_says_ni(*args, **kwargs):
2
3 price = 0.00
4 unique_letters = set()
5
6 for key in args:
7 if type(key) == dict and'name' in key:
8 if key['name'].lower() in ["храст", "shrub", "bush"]:
9 if 'cost' in key:
10 price+=key['cost']
11
12 for key, value in kwargs.items():
13 if type(value) == dict and 'name' in value:
14 if value['name'].lower() in ["храст", "shrub", "bush"]:
15 if 'cost' in value:
16 price+=value['cost']
17
18 for letter in key:
19 unique_letters.add(letter)
20
21
22 if int(price) > 0 and len(unique_letters) % int(price) == 0 and price<=42.00:
23 return f'{price:.2f}лв'
24
25 return 'Ni!'
..........
----------------------------------------------------------------------
Ran 10 tests in 0.000s
OK
22.10.2024 13:45
22.10.2024 13:45
22.10.2024 13:45
22.10.2024 13:46
22.10.2024 13:47