Answered step by step
Verified Expert Solution
Link Copied!

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

image text in transcribed

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

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

Expert Oracle Database Architecture

Authors: Thomas Kyte, Darl Kuhn

3rd Edition

1430262990, 9781430262992

More Books

Students also viewed these Databases questions

Question

Talk to me Sandra said before you change a thing.

Answered: 1 week ago