Python File Handling - Quiz

  • AWhen you open a file for reading, if the file does not exist, an error occurs
  • BWhen you open a file for writing, if the file does not exist, a new file is created
  • CWhen you open a file for writing, if the file exists, the existing file is overwritten with the new file
  • DAll of the mentioned
  • AOpens an existing text file named python.csv to write
  • BOpens an existing text file named python.csv to append
  • COpens an existing text file named python.csv to read
  • DOpens a new file named python.csv to read
  • AOpens a text file named python.txt to read
  • BOpens a text file named python.txt to write to or read from
  • COpens a text file named python.txt to write
  • DOpens a new file named python.txt to append
  • AOpens a text file named python.txt to read
  • BOpens a text file named python.txt to read and write
  • COpens a text file named python.txt to write to
  • DOpens or creates a text file named python.txt to read from or write to at the end of the file
  • AOpens or creates a binary file named python.bat to write
  • BOpens or creates a binary file named python.bat to append
  • COpens or creates a binary file named python.bat to read
  • D Opens a new file named python.bat to write
  • AOpens or creates a binary file named python.bat to write
  • BOpens or creates a binary file named python.bat to append
  • COpens or creates a binary file named python.bat to read
  • DOpens a new file named python.bat to append
  • Apython
  • Bpython.txt opened
  • Cpython.txt or FileNotFoundError
  • Dpython r