I have a variable that reads values from a file. It doesn't return empty when I just print the variable, but it returns empty when I print the variable and other words. This is really weird.
My code:
f = open(file, "r")
print("f.read(): " + f.read()) // Successfully returns the text in the file
print('"ABC" + f.read() + "ABC": ' + "ABC" + f.read() + "ABC") // Unexpected return ""ABC" + f.read() + "ABC": ABCABC"
Why is there such a strange thing? How to solve this problem? I would appreciate any help. Thank you in advance!