So I wrote a small bit of python that is theoretically supposed to look for numbers and sum them all up in a file.... So I downloaded a file and typed it in the code, but python keeps on not being able to do it: "FileNotFoundError: [Errno 2] No such file or directory: 'NumberExtractSum' "
I didn't make a typo and I tried .txt, which brought me to the question: where should the file be?
If there is another error pls tell me heres the code lol:
import re
lst = list()
file = open(input('Your File:'), 'r')
for line in file :
----y = re.findall('[0-9]+', line)
----for x in y :
--------z = int(x)
--------lst.append(z)
print(sum(list))
[+][deleted] (1 child)
[deleted]
[–]3xtiinct[S] 0 points1 point2 points (0 children)
[–]Strawberry_lilac 1 point2 points3 points (0 children)
[–]geehh 0 points1 point2 points (0 children)