PythonLobby
  • Core Python
  • File Handling
  • Python – SQLite
  • Python – GUI
  • Python Exercises
  • More
    • Core Python
    • File Handling
    • Python SQLite
    • Python GUI
    • Python Exercises
  • File Handling
    • Introduction
  • For Text Files
    • Open – Text File
    • Write – Text File
    • Append – Text File
    • Read – Text File
    • seek() and tell()
    • Writing Multiple Data
    • Update – Text File
    • Delete – Text File
  • For Binary File
    • Pickling & Unpickling
    • Write – Binary File
    • Writing Multiple Data
    • Read – Binary File
    • Reading Multiple Data
    • Append – Binary File
    • Update – Binary File
    • Search – Binary File
    • Delete – Binary File
  • SIDEBAR
    • Home
    • Contact us
    • About us
    • Privacy & Policy
Previous
Next

questions-on-file-handling-in-python

As we have learned all about the basic to advanced operations of File Handling. Hence now we will solve some questions related to our File Handling concepts.

Programming questions on Text Files

  1. WAP to define a method to read text document line by line.
  2. WAP to define a method in python to read lines from a text file starting with an alphabet F.
  3. WAP to define a method to count number of lines starting with an alphabet F.
  4. WAP to define a method which display only those lines starting with an alphabet A or F.
  5. WAP to define a method to display only those lines which are bigger than 50 characters.
  6. WAP to define a method to count total number of characters in our text file.
  7. WAP to define a method to count total numbers of word available in our text file.
  8. WAP to define a method which counts the occurrence of particular word in a text file.
  9. WAP to define a method which only print the words having more than 5 characters.
  10. WAP to define a method which counts the occurrence of “is”, “to” in a text file.

Programming questions on Binary Files

  1. WAP to define a method which displays the records of student having marks between 50 & 70.
  2. WAP to define a method which displays only those student records who secured grade A.

Previous
Next
    • Loop Exercises
    • Function Exercises
    • String Exercises
    • Input Output Exercises
    • List Exercises
    • Dictionary Exercises
  • About Python Lobby
    we at PythonLobby.com committed to provide great content for learning new technology stacks step by step. We use basic approach to make content more simplified to understand. While using this site, you agree to our terms of use and privacy policy.
    • letuslearn0007@gmail.com
    Quick Links
      • About us
      • Contact us
      • Privacy & Policy
      • Terms and Conditions
  • Subscribe Our Newsletter
    Subscribe to our newsletter to get weekely updates direct into your inbox.

  • We respect your privacy.

    • About us
    • Contact us
    2022 PythonLobby.com. All Rights Reserved.