Advertisement
biswasrohit20

3

Apr 5th, 2021
237
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.21 KB | None | 0 0
  1. f = open("numbers.txt", "r")
  2. cont = f.readlines()
  3.  
  4. total = 0
  5.  
  6. for line in cont:
  7. for i in line:
  8. if i.isdigit()== True:
  9. total += int(i)
  10.  
  11. print("The sum is: " + str(a))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement