gpt4 book ai didi

python - python中strcmpi的类似功能

转载 作者:塔克拉玛干 更新时间:2023-11-02 23:24:43 25 4
gpt4 key购买 nike

<分区>

Possible Duplicate:
How do I do a case insensitive string comparison in Python?

我想知道是否有类似strcmpi的功能或者对它的一些规定。

假设如果用户输入单词 harry potter 并且我的文件中有这个单词以 Harry Potter 的形式书写,那么我该如何比较它因为它只是忽略了这个因为大小写字母。

如果我想将“实例”类型对象转换为 str 怎么办。我怎样才能做到这一点 ?

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