Write two programs that demonstrates Lists and also File Operations.The first program should have a loop and ask the user for 5 numbers (or an indefinite loop asking for numbers until the user gives a...

1 answer below »

Write two programs that demonstrates Lists and also File Operations.





The first program should have a loop and ask the user for 5 numbers (or an indefinite loop asking for numbers until the user gives a stop value if you want to do it that way) and it should write the numbers to a data file and save them.






The second program should open the data file and read the numbers into a list. The program should then print the numbers in the list and total up the numbers in the list and print the total of them too.
Answered 2 days AfterDec 06, 2022

Answer To: Write two programs that demonstrates Lists and also File Operations.The first program should have a...

Supriya answered on Dec 08 2022
39 Votes
Program-1:
number_write.py
A python program askes for user to enter 5 numbers.
A try and except b
lock is used to check whether the input by user is a number. If it is number it is added to the list, else user is prompted to enter numbers.
A .dat file is a data file which stores all the numbers...
SOLUTION.PDF

Answer To This Question Is Available To Download

Related Questions & Answers

More Questions »

Submit New Assignment

Copy and Paste Your Assignment Here