55.Programming Assignment 12-using Files

1.Input list of strings and create a text file with this sequence.
2.Copy one file to another ( text and binary ( image))
3.Copy one python program file to another after removing the single line comments
( lines starting with #)
4.Read and print a file with line numbers of each line.
5.Read and print a file with all punctuation removed.( university question)
6.Write a python program to create a file with 10 integer numbers. Read this file and display the square of each number. (University question)
7.Write a program that reads a file and writes out a file with the lines in reversed order.( university question-refer example)
8.Write a python program to read a text file, copy the content to another file after removing the blank lines.( university question)
9.Count the number of lines, number of words and number of characters in a file.
10.Program to read a text file and print the words and its length in sorted order.( refer example)
11.Write a Python program that opens a file for input and prints the count of four letter words.( university question..)
12.write a program to read numbers stored in one file and store the sorted numbers in another file after deleting duplicates.(university question-refer example)
13.Read a file and display the lines with number of words in each line. Use a function exist() which will handle an exception if the file does not exist.
14.Write a python program to read numbers from a file named num.txt.Write all positive numbers from num.txt to file named positive.txt and all negative numbers to negative.txt.(university question)
15.Write a Python program to store lines of text into a file.Read the file and display only the palindrome words in the file.(university question)
16.Write a python program to input list of n numbers. Calculate cube of each number and store it in a file.( university question)
17.Write a Python program to create a text file. Read the contents of the file, encrypt every character in the file with a distance of 3 and write it to a new file.
Eg:yak is encrypted as bdn.( university question)
18.Replace all the string pyton with python in a file

Comments

Popular posts from this blog

Python For Machine Learning - CST 283 - KTU Minor Notes- Dr Binu V P

KTU Python for machine learning Sample Question Paper and Answer Key Dec 2020

46.Classes and Objects in Python- Accessors and mutators