I have a text file (buy_sell.txt) containing the word "BOUGHT". No new lines or spaces.
When I try to check if the contents of the file ("BOUGHT") are equal to "BOUGHT" it evaluates to false!
f = open("buy_sell.txt", "r")
print(f.read())
if(f.read() == "BOUGHT"):
print('works')
How do I get the code to evaluate to true?
f.read()will give you''.f.read().