> "spam" >> "spam" >> "Spam"-6ren">
gpt4 book ai didi

python - 字符串比较如何在 python 上工作?

转载 作者:太空狗 更新时间:2023-10-30 02:12:48 26 4
gpt4 key购买 nike

<分区>

>>> "spam" < "bacon"
False
>>> "spam" < "SPAM"
False
>>> "spam" < "spamalot"
True
>>> "Spam" < "eggs"
True

如何比较等长字符串?为什么 “Spam” 小于 “eggs”?如果字符串的长度不同怎么办?

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