PracticeExercises Files
PracticeExercises Files
Exercise 1:
Create a program that opens file.txt. Read each line of the file and prepend it with a line
number.
Sample output:
Exercise 2:
Read the contents of animals.txt and produce a file named animalssorted.txt that is sorted
alphabetically.
man
bear
pig
cow
duck
horse
dog
LinuxTrainingAcademy.com
After the program is executed the contents of animalssorted.txt should be:
bear
cow
dog
duck
horse
man
pig
LinuxTrainingAcademy.com