Somewhere, Something Incredible Is Waiting To Be Known !!!
(Move to ...)
Home
▼
Tuesday, 10 March 2020
Python to get only digits from a file and append into a list
f = open('file2.txt', 'r')
for line in f:
words = line.split()
for i in words:
if(i.isdigit()):
mylist.append(i)
print (mylist)
No comments:
Post a Comment
‹
›
Home
View web version
No comments:
Post a Comment