$25
Write assert based programs.
1. Text file contains ‘n’ numbers. Compute the sum of ‘n’ numbers present in file.
2. Write function to generate square of a number. Numbers comes from text file. Squared number should be written to another file.
3. Text file contains ‘n’ numbers, one number per line. Write function to store the numbers in other file in reversed order. (Let as assume that source.txt contains 10, 25, 30, 35, 50. Then dest.txt should contain 50, 35, 30, 25, 10).
4. Text file contains some text data (some sentences). Write function to compute number of times a pattern present in the given text data. Pattern is passed as argument to function.
5. Text file contain one sentence per line. Write function to find the length of each lines and write it to another file. Function should return length of longest sentence