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.
与此相关的问题有很多,尽管它们没有解释如何获取用户输入的单词并在方程式中使用它们。我该怎么做?
你的意思是找到字符串的长度使用 len("string")
如果要查找不同类型的字母数,请使用计数器
from collections import Counter a = Counter("stringsss") print a['s']