Answered step by step
Verified Expert Solution
Question
1 Approved Answer
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 1380Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started