小编use*_*897的帖子

如何在Python中检查2个字符串是否包含相同的字母和数字?

我想检查两个字符串是否包含相同的字母和数字

忽略特殊字符,例如_

例子:

word1 = "ABCD" , word2 = "ACDB"  => return True
word1 = "ABC1E_" , word2 = "AE1CB" => return True
word1 = "AB12" , word2 = "ABE2" => return False
word1 = "ABB" , word2 = "AB" => return True 
Run Code Online (Sandbox Code Playgroud)

python string string-comparison

2
推荐指数
1
解决办法
1万
查看次数

标签 统计

python ×1

string ×1

string-comparison ×1