Question: Do by Python please. Page of 2 0 70KOM + Practice Exercises - Files Exercise 1: Create a program that opens file.txt. Read each line
Do by Python please.


Page of 2 0 70KOM + Practice Exercises - Files Exercise 1: Create a program that opens file.txt. Read each line of the file and prepend it with a line number. The contents of files.txt: This is lind ons. This is lire Lwo, Finally, we are on the third and last line of the file. Sample output: 1: This is line one. 2: This is linc TWO. ?; Finally, we are on the third and last line of the rile. Exercise 2: Pages 1 > of 2 70KOM + a. Te Exercise 2: Read the contents of animals.txt and produce a file named animals-sorted.txt that is sorted alphabetically, The contents of animals.txt: man bear pig COW cuck horac Page
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
