python string differences
I am seeing that a string comparison of two identical strings ('fraiser') in Python is failing. When using repr(str1)
and repr(str2)
I get different results, but I don't know how to interpret them or why they return different things. Any help?
>>> repr(list(lowerAndMakeSet(fileChunks))[3])
"'frasier'"
>>> repr开发者_如何学Go(list(lowerAndMakeSet(c))[2])
"['f', 'r', 'a', 'i', 's', 'e', 'r']"
Your second "string" that you are repr
ing is actually a list and not a string. You can see this if you do type(list(lowerAndMakeSet(c))[2])
.
精彩评论