from collections import Counter
def word_frequency(text):
words = text.lower().split()
return Counter(words)
print(word_frequency("Python is great and python is easy"))
def filter_data(data, min_age, max_salary):
return [
person
for person in data
if person['age'] >= min_age
and person['salary'] <= max_salary
]
people = [
{"name": "Alice", "age": 25, "salary": 4000},
{"name": "Bob", "age": 19, "salary": 2500},
{"name": "Charlie", "age": 30, "salary": 6000},
]
print(filter_data(people, 21, 5000))