生成一个长度为10的随机字符串，其中只包含大写字母和数字。
One possible way to generate a random string of length 10 containing only uppercase letters and numbers is:

```python
import random
import string

random_string = ''.join(random.choices(string.ascii_uppercase + string.digits, k=10))
print(random_string)
``` 

This code uses the `random` module to generate a random string of length 10, and the `string` module to get the uppercase letters and digits. The `join()` method is used to concatenate the randomly-chosen characters into a single string.