I just can't seem to solve this. I know others use this exact code and it works for them; why would I get an error and others not? I use Python 3.6.3
with open('Numbers.txt') as f:
alist = [int(num) for num in f]
print(alist[0])
print(alist[99999])
print(alist())
Output:
54044
91901
Traceback (most recent call last):
File "test3.py", line 8, in <module>
print(alist())
TypeError: 'list' object is not callable
Also did below with the same error:
with open('Numbers.txt') as f:
numbers = f.readlines()
numbers = [int(x.strip()) for x in numbers]
print(numbers[0])
print(len(numbers()))