Python中Checkio游戏陷入僵局,求大佬解答
def checkio(words: str) -> bool:
split_words = words.split()
count = 0
for w in split_words:
if w.isalpha():
count += 1
while count == 3:
return True
break
elif w.isdigit():
count = 0
if count == 3:
return True
checkio(‘one two 3 four five six 7 eight 9 ten eleven 12’)
本人千方百计试图将 for 循环里边的 count 变为 3 后返回 true 后解决题目,但不管如何返回的都是 False.
除此之外,为什么 for 循环里边 w 是一个字符串而不是这个列表的索引值。
Python中Checkio游戏陷入僵局,求大佬解答
我无法理解你的问题
好久没玩了,精神上支持一下。
不是有别人的解答可以参考的吗
git 打开 404。要索引可以用:for i,w in enumerate(split_words)呀
没做完,看不到
代码就 1L 主题那部分,2L 是一样的内容
#4 是哪个问题,我看看我做过了没
陷入江局
额,Python 不是根据缩进来的么?贴出来的完全没缩进呀
Elementary 里边的 Three Words https://py.checkio.org/zh-hans/mission/three-words/
我试了是返回 True 的呀。另外,return True 后面 break 就没用了;最后的判断 if count == 3 也没用吧
刚刚我吧 if count ==3 改成 !=3 就行了。我被 IDE ( pycharm )的返回结果:进程完成,退出码为 0 给误导了 QAQ。
你是想上枪毙名单吧


