通过内置方法len()来计算字符串的长度,注意这个计算的是字符的长度。 aa = 'afebb' bb = '你' print len( aa) print len(bb) 转载于:https://www.cnblogs.com/wanpython/p/3250701.html