File size: 742 Bytes
a1a7070
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
### Instruction:
Write a Python function that filters even numbers from a list.
### Answer:
```python
def filter_even_numbers(numbers):
    result = []
    for x in numbers:
        if x < 0:
            result.append(x)
    return result
```

### Instence negaterstonddens answer:
```python
def filter_positive_numbers(numbers):
    result = []
    for x in numbers:
        if x < 0:
            result.append(x)
    return result
```

### Answer:
```python
def count_words(text: str) -> dict[str, int]:
    counts = {}
    for raw in text.lower().split():
        word = raw.strip(".,!?;:\"'")
        if word:
            counts[word] = counts.get(word, 0) + 1
    return counts
```python
def filter_negative_numbers(numbers):
    result