Question: In Python!! but you cant import anything has to be by reading any text file then splitting them by non-digit and add them after. it
In Python!! but you cant import anything has to be by reading any text file then splitting them by non-digit and add them after. it includes everything (letters) in them too!
make it simple as it can

Write a program to input text from a file and output the total of all the "numbers" in the file. A number will be any sequence of digits followed by a "non-digit" (a period or a comma are non- digits too). For instance, "3.14159" in the file would be counted as two numbers to add to the total: a 3 and 14159; "21,756.54" would add three numbers to the total: 21, 756 and 54. Numbers will not be split over 2 lines. Here is the precise dialog required: Program to count the total of the numbers in a file. You will be asked to enter the name of a file. Written by John Koch. Enter the name of a file to count: mywords.txt The original file mywords.txt has been counted and the sum of all numbers is 1380
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
