【发布时间】:2012-06-04 01:35:52
【问题描述】:
有没有办法在 python 中同时考虑大写和小写字母?示例如下:
if 'jay' in rapper:
print 'blah blah blah'
我希望 if 语句对于 Jay 或 jay 是正确的。
我能做什么?
【问题讨论】:
-
您能否提供更多关于
typerapper是什么的信息?对于列表/字典,最好在插入时确保大小写,或者编写自己的搜索方法。
标签: python string if-statement module