Python 字典长度计算:len({'A':10, 'B':20, 'C':30, 'D':40})
Python 中,使用 len() 函数可以计算字典的长度。
例如,字典 {'A':10, 'B':20, 'C':30, 'D':40} 的长度为 4。
print(len({'A':10, 'B':20, 'C':30, 'D':40}))
输出结果:
4
原文地址: https://www.cveoy.top/t/topic/owgc 著作权归作者所有。请勿转载和采集!
安全问答是一个知识全球问答,包含丰富的问答知识
Python 中,使用 len() 函数可以计算字典的长度。
例如,字典 {'A':10, 'B':20, 'C':30, 'D':40} 的长度为 4。
print(len({'A':10, 'B':20, 'C':30, 'D':40}))
输出结果:
4
原文地址: https://www.cveoy.top/t/topic/owgc 著作权归作者所有。请勿转载和采集!