def zifu(str1,str2): if len(str1) != len(str2): return 1 else: if str1 == str2: return 2 elif str1.lower()== str2.lower(): return 3 else: return 4 print(zifu('Beijing','beijing'))
蓝桥杯——字符串对比
最新推荐文章于 2024-07-12 01:22:50 发布
![](https://img-home.csdnimg.cn/images/20240711042549.png)
def zifu(str1,str2): if len(str1) != len(str2): return 1 else: if str1 == str2: return 2 elif str1.lower()== str2.lower(): return 3 else: return 4 print(zifu('Beijing','beijing'))