Practice 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…
StudyTrigger
-
-
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…
-
Python Programs
Python: Find the Longest Word in a Text File (Solved)
by Mahesh Vermaby Mahesh VermaPractice Question 8 In this question, we will learn how to write a function that scans a text file and identifies the longest word present in it. This logic is…
-
Python Programs
Python: Count Frequency of Each Alphabet in a Text File (Solved)
by Mahesh Vermaby Mahesh VermaPractice Question 5 In this post, we will learn how to write a function that reads a text file and counts how many times each alphabet (a to z) appears.…
-
Python Programs
Python: Replace Digits with ‘#’ and Save to New File (Solved)
by Mahesh Vermaby Mahesh VermaPractice Question 4 In this post, we will learn how to write a function that reads a file, replaces every digit with a ‘#’ symbol, and saves that modified version…
-
ProgramsPython Programs
Python: Display Special Symbols from a Text File (Solved)
by Mahesh Vermaby Mahesh VermaPractice Question 2 In this post, we will learn how to write a function that finds and displays all the special symbols (like @, #, $, etc.) present in a…
-
Python Programs
Python: Count Consonants in a Text File (Solved Practice Question)
by Mahesh Vermaby Mahesh VermaPractice Question 1 In this post, we will look at how to read a text file and count the number of consonants. This is a very common logic used in…