I'm having the user input a file to open which contains numbers. I want the output to be the number of elements in the file. I put..
file=open(input("Please enter the name of the file you wish to open:" ))#, "r")
A= file.readline()
print (A)
n=len(A)
print (n)
I am very new to this. The file I am testing it with has 9 numbers (2 of which are negative). The length comes out to 21. How can I change this to get the number of elements?