Read a file in reverse
Write a Python program to print the lines of a file in reverse order, and the whole text reversed. Step-by-step explanation, colour-coded code and real output.
Online Learning Platform
Free tutorials, solved practice problems and interview prep for QA and automation engineers: Python, Playwright, Selenium, SQL, Git and more.
Write a Python program to print the lines of a file in reverse order, and the whole text reversed. Step-by-step explanation, colour-coded code and real output.
Write a Python program to move the cursor to a specific position in a file. Step-by-step explanation, colour-coded code and real output.
Write a Python program to find the current cursor position in a file. Step-by-step explanation, colour-coded code and real output.
Write a Python program to count special characters (not letters, digits or whitespace) in a file. Step-by-step explanation, colour-coded code and real output.
Write a Python program to count the digits in a file. Step-by-step explanation, colour-coded code and real output.
Write a Python program to count lowercase letters in a file. Step-by-step explanation, colour-coded code and real output.
Write a Python program to count uppercase letters in a file. Step-by-step explanation, colour-coded code and real output.
Write a Python program to count the characters in a file, with and without whitespace. Step-by-step explanation, colour-coded code and real output.
Write a Python program to read two files and write their contents into a new file. Step-by-step explanation, colour-coded code and real output.
Write a Python program to extract the characters (not spaces or newlines) of a file into a list. Step-by-step explanation, colour-coded code and real output.
Write a Python program to check whether a file is closed. Step-by-step explanation, colour-coded code and real output.
Write a Python program to write a tuple to a file and read it back. Step-by-step explanation, colour-coded code and real output.
Take free timed mock tests with answers and explanations.