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.
我需要使用 .count 东西并将其与 if 语句结合起来检查字符串中的 2 个相同字符
到目前为止我什么都没有
另外我是python的初学者,所以请使用简单的东西让我理解
你的意思是这样吗?
>>> if 'aba'.count('a') >= 2: print (True) else: print(False) True