I want to compare a text file content to a string in the code
test.txt
a
b
c
d
I used print(r[0]) and print(st[0]) to virify the values however the ourput is always "No" code:
st=["a","b"]
with open("test.txt", "r+") as input:
r =input.readlines()
input.close()
print(r[0])
print(st[0])
if r[0] == st[0]:
print("yes")
else:
print("No")