Dunnhumby Interview Question | Processing Modes

Question

What are the different file processing modes supported by Python? Explain them using appropriate examples.

in progress 0
Dhruv2301 55 years 0 Answers 900 views Great Grand Master 0

Answers ( No )

  1. r – open a file for reading. (default)

    w – Open a file for writing. If file already exists its data will be cleared before opening. Otherwise new file will be created

    x – open for exclusive creation, failing if the file already exists

    a – open for writing, appending to the end of the file if it exists

    b – binary mode

    t – text mode (default)

    +r – Open a file for updating (reading and writing)

Leave an answer

Browse
Browse