Write a Python function `frequency(lst, num)` that takes a list of integers `lst` and an integer `num` as input and returns the number of times `num` appears in `lst`.
#### Example Usage
```python [main.nopy]
print(frequency([1, 2, 3, 4, 2, 2], 2)) # Output: 3
print(frequency([5, 5, 5, 5], 5)) # Output: 4
print(frequency([1, 2, 3], 4)) # Output: 0
```
#### Constraints
- The input list can contain any integers, including negative numbers.
- The function should return `0` if the number does not appear in the list.