请编写一个程序，它接受一个字符串，并计算字母和数字的个数。结果应该以字典形式返回。
string = "Hello123World456"
# TODO: count the number of letters and numbers in the provided string
以下是Python 3的代码，可以计算输入字符串中字母和数字的数量，并将结果输出为字典：

```python
def count_letters_and_numbers(string):
    letter_count = 0
    number_count = 0
    for char in string:
        if char.isalpha():
            letter_count += 1
        elif char.isnumeric():
            number_count += 1
    return {'letters': letter_count, 'numbers': number_count}

string = "Hello123World456"
result = count_letters_and_numbers(string)
print(result)  # 输出：{'letters': 10, 'numbers': 6}
```