aclongo / finding_numbers

This is my solution for "Finding Numbers in a Haystack" from Chapter 11 of Python for Everybody

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

finding_numbers

This is my solution for "Finding Numbers in a Haystack" from Chapter 11 of Python for Everybody.

The assignment was: "Write a program that can read through and parse a file with text and numbers. It should extract all the numbers in the file and compute the sum of the numbers."

How I went above and beyond:

  • Allowing user input of a text file name
  • Using 'try' and 'except FileNotFoundError' to prevent the program from crashing with bad input
  • Keeping track of the current line number
  • Printing the numbers found with each line number
  • Printing statements for the final count and sum of numbers

About

This is my solution for "Finding Numbers in a Haystack" from Chapter 11 of Python for Everybody


Languages

Language:Python 100.0%