擅长:python、mysql、java
<pre><code>lst = []
with open('New Text Document.txt', 'r') as f: #open the file
lines = f.readlines() # combine lines of file in a list
for item in lines: # iterate through items of lines
# iterate through items in each line and remove extra space after last item in the line using strip method
for digit in item.strip():
lst.append(int(digit)) # append digits in to the list and convert them to int
print(lst)
[7, 3, 1, 6, 7, 1, 7, 6, 5, 3, 1, 3, 3, 0, 6, 2, 4, 9, 1, 9]
</code></pre>