题解 | 字符串之间的比较
字符串之间的比较
https://www.nowcoder.com/practice/c207a15115764206b06d367abda91522
str1 = input() str2 = input() print(str1 == str2) print(str1.lower() == str2.lower()) # 字符串是不可变的(immutable),因此lower()不会改变原始字符串,而是返回一个新的字符串
字符串之间的比较
https://www.nowcoder.com/practice/c207a15115764206b06d367abda91522
str1 = input() str2 = input() print(str1 == str2) print(str1.lower() == str2.lower()) # 字符串是不可变的(immutable),因此lower()不会改变原始字符串,而是返回一个新的字符串
相关推荐