Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- f = open("numbers.txt", "r")
- cont = f.readlines()
- total = 0
- for line in cont:
- for i in line:
- if i.isdigit()== True:
- total += int(i)
- print("The sum is: " + str(a))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement