Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

Python Programs (Files Questions) Using python 3 functions and files 1. Line Numbers; It should be able to handle IOError and ValueError exceptions. Write a

Python Programs (Files Questions)

Using python 3 functions and files

1. Line Numbers; It should be able to handle IOError and ValueError exceptions.

Write a program that asks the user for the name of a file. The program should display the contents of the file with each line preceded with a line number followed by a colon. The line numbering should start at 1.

2. Random Number File Writer

Write a program that writes a series of random numbers to a file. Each random number should be in the range of 1 through 500. The application should let the user specify how many random numbers the file will hold.

3. Use the file you have created in the previous question. Write a program that calculates the average of all numbers, and reports how many numbers are there that are greater than 250 and sum of all numbers smaller than 250.

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_2

Step: 3

blur-text-image_3

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

Hands On Database

Authors: Steve Conger

1st Edition

013610827X, 978-0136108276

More Books

Students also viewed these Databases questions

Question

How to solve maths problems with examples

Answered: 1 week ago

Question

What is the Definition for Third Normal Form?

Answered: 1 week ago

Question

Provide two examples of a One-To-Many relationship.

Answered: 1 week ago