'Python reading from csv file, same strings with "-" sign doesn't match
I have written a program that looks through all items in a csv file and checks if a given input is in the list. It compares two strings based on the == operator: one string from the program and one from the file. Everything worked fine until one of the values had "-" in it. For some reason even though those two strings look identical to me when I compare them in if statement they do not match.
word = "Don Ho – Notepad ++"
if(word == word_from_file):
print("They are the same")
So I have copied the above string from my source code to the file and I've printed all the values from my file to console and he Don Ho - Notepad++ got printed as "Don Ho – Notepad ++" even though I copied the name from the above code and pasted it in my file. Both files use UFT-8. I copied the "Don Ho - Notepad++" from elsewhere and pasted it in the csv file and then it got printed as "Don Ho - Notepad++" but the comparison still doesn't work.
Any ideas what could be causing it?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
