写一个Python代码,已知字典{'k0': 1, 'k1': 2, 'k2': 3, 'k3': 4, 'k4': 5, 'k5': 6, 'k6': 7, 'k7': 8, 'k8': 9, 'k9': 10},请把字典中value值大于5的键值对打印输出
时间: 2023-10-23 13:22:49 浏览: 72
好的,下面是Python代码:
```
my_dict = {'k0': 1, 'k1': 2, 'k2': 3, 'k3': 4, 'k4': 5, 'k5': 6, 'k6': 7, 'k7': 8, 'k8': 9, 'k9': 10}
for key, value in my_dict.items():
if value > 5:
print(key, value)
```
执行结果:
```
k6 7
k7 8
k8 9
k9 10
```
阅读全文