Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
join_word = ' '.join(word) len_join_word = len(join_word)
我试图获得 join_word 的 len 但它什么也没打印出来。
获得join_word的len的任何可能方法?
你做对了:
In [1]: word=['a', 'sdfs', 'sdfsdfsfs'] In [2]: join_word = ' '.join(word) In [3]: len_join_word = len(join_word) In [4]: print(len_join_word) 16
您可能什么都看不到,因为您没有打印出结果。尝试print(len_join_word)在最后添加。
print(len_join_word)