1 ответ
+ 3
f = open ("file.txt","r")
print (int(f.read))
TypeError: int() argument must be a string, a bytes-like object or a number not 'builtin_function_or_method'
You are trying to convert the "read" method (a function definition) to an integer. You should be calling it instead (so that you convert its output):
f.read()
If you want to test with a file here on SoloLearn, create the file first:
#####
with open("file.txt", "w") as f:
f.write("42")