Are you pressed for time and haven’t started working on your assignment yet? Would you like to buy an assignment? Use our custom writing services for better grades. Even if your deadline is approaching fast, our writers can handle your task right when you need it. Our writers will complete your order from scratch and make sure it’s completely unique.
Order a Similar Paper Order a Different Paper
Lab 1 PART A
complete the following programming exercises.
file into a list. The program should then process the numbers in the list and display the following information:
Notes There are several issues that will be need to be addressed to make lab 3 work:
- A line break (n)exists at the end of each record (row) . When reading the file, use the method replace() to replace line breaks with null (“”)
- Records on the file are stored as strings. When reading the file, use the method int() to convert the strings back to ints.
LAB 1 PART B
- Write a program that writes a series of randomâ€ integers, one per line, to a file. Each random number should be in the range of 1 to 500. The application should first prompt the user to specify how many random numbers the file should hold. Include a custom try/exception block to verify that the user entered a number > 0. Include a try/exception block to verify that the user entered an integer. Note: records must be stored as strings – see method str()
- (Extra Credit) Write a program that takes as input the file statesPopulation.txt. Add to a list and report. :
- format: state, population, abbreviation
- Sort by state name
- Report on state name and population (consider method split())
- Format population with commas (convert to int)
Save your programs in plain text files and submit these by the due date/time.