I have a file that has numbers like this in it:
5
10
15
20
I know how to write code that reads the file and inputs the numbers into a LIST but how do I write code that reads the file and inputs the number in a TUPLE if a tuple doesnt support the append function? this is what I got so far:
filename=input("Please enter the filename or path")
file=open(filename, 'r')
filecontents=file.readlines()
tuple1=tuple(filecontents)
print(tuple1)
the output is this:
('5\n', '10\n', '15\n', '20\n')
it should be this:
5,10,15,20