Practice Question 24 In this question, we will learn how to write a function that takes a “messy” file containing multiple spaces between words and cleans it up so that…
B.Tech
-
-
Practice Question 28 In this question, we will learn how to write a function that takes the content of two separate files and joins them into a third file. We…
-
Python Programs
Python: Remove Lines Containing Digits from a File (Solved)
by Mahesh Vermaby Mahesh VermaPractice Question 30 In this question, we will write a function that acts as a “Text Purifier.” It reads details.txt and removes every line that contains even a single numeric…
-
Python Programs
Python: Capitalize the First Letter of Each Word in a File (Solved)
by Mahesh Vermaby Mahesh VermaPractice Question 23 In this question, we will learn how to write a function that acts like an “Auto-Corrector.” It will read a file and ensure every word starts with…
-
Practice Question 20 In this question, we will learn how to write a function that takes the text from one file and writes it into another file in complete reverse…
-
Python Programs
Python: Delete Lines Starting with a Specific Character (Solved)
by Mahesh Vermaby Mahesh VermaPractice Question 15 In this question, we will learn how to write a function that takes a character from the user and removes all lines from a file that begin…
-
Python Programs
Python: Display Alternate Lines from a Text File (Solved)
by Mahesh Vermaby Mahesh VermaPractice Question 12 In this question, we will learn how to write a function that reads a file and displays only the alternate lines (1st, 3rd, 5th, etc.). This logic…
-
Python Programs
Python: Count Lines Ending with a Full Stop (Solved)
by Mahesh Vermaby Mahesh VermaPractice Question 11 In this question, we will learn how to write a function that counts how many lines in a text file end with a full stop (.). This…
-
Python Programs
Python: Display Words with Length Greater than 5 (Solved)
by Mahesh Vermaby Mahesh VermaPractice Question 10 In this question, we will learn how to write a function that reads a text file and extracts only the “Long Words”—specifically those that have more than…
-
Python Programs
Python: Remove Duplicate Words from a Text File (Solved)
by Mahesh Vermaby Mahesh VermaPractice Question 9 In this question, we will learn how to read a file, identify duplicate words, and overwrite the file so it only contains unique words. This is a great…