workers = [1, 2, 3, 4]
# Using *workers in a print statement
print(*workers) # Output: 1 2 3 4
min/max([], default=0) # Returns 0
```python
for k,v in d.items():
v.reserse() #v is a list
```
return [i for i,_ in collections.Counter(nums).most_common(k)]
# Example list of tuples
data = [(1, 3), (4, 1), (5, 2)]
# Sorting the list based on the second element of each tuple
sorted_data = sorted(data, key=lambda x: x[1])
# Output: [(4, 1), (5, 2), (1, 3)]
print(sorted_data)
# Example dictionary
data = {'a': 3, 'b': 1, 'c': 2}
# Sorting the dictionary by its values
sorted_data = sorted(data.items(), key=lambda x: x[1])
# Output: [('b', 1), ('c', 2), ('a', 3)]
print(sorted_data)
# Example list of dictionaries
data = [{'name': 'John', 'age': 25}, {'name': 'Jane', 'age': 22}, {'name': 'Doe', 'age': 30}]
# Sorting by the 'age' key
sorted_data = sorted(data, key=lambda x: x['age'])
# Output: [{'name': 'Jane', 'age': 22}, {'name': 'John', 'age': 25}, {'name': 'Doe', 'age': 30}]
print(sorted_data)
d.extend(lst)
from functools import lru_cache # Import lru_cache
@lru_cache(None)
#滤掉所有非(),因为count返回返回1或0
s = "a(b)c)d"
result = ''.join(filter('()'.count, s))
print(result) # Output: "()()"