edrevo
edrevo

Reputation: 1433

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(list(lowerAndMakeSet(c))[2])

"['f', 'r', 'a', 'i', 's', 'e', 'r']"

Upvotes: 0

Views: 413

Answers (1)

user193476
user193476

Reputation:

Your second "string" that you are repring is actually a list and not a string. You can see this if you do type(list(lowerAndMakeSet(c))[2]).

Upvotes: 5

Related Questions