gpt4 book ai didi

python - 如何检查空字符串是否在一个单词中在 python 中评估为真?

转载 作者:太空宇宙 更新时间:2023-11-04 00:58:18 25 4
gpt4 key购买 nike

<分区>

这可能是一个非常基本的问题,我应该知道这一点,但是下面这行如何评估为真?

>>> '' in 'spam'
True

为什么/非空字符串中的空字符串/字符是什么?我在 Idle for Python 2.7 中试过这个,它的评估结果为真。我从 Automate the Boring Stuff 的链接中找到了这个第六章

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com