len( str )比如:
str_ = 'how old are you' str_1 = ['how', 'old', 'are', 'you'] print(len(str_)) print(len(str_1))
字符串,列表都是可以len(str)的如果非得str.的形式的话,可以尝试这种
str_ = 'how old are you' print(str_.__len__())
也是可以出结果的