A

Admin • 832.52K Points
Coach

Q. Which of the following is the correct way to open a file for reading?

  • (A) open('file.txt', 'read')
  • (B) open('file.txt', 'r')
  • (C) read('file.txt')
  • (D) file('file.txt', 'r')
  • Correct Answer - Option(B)
  • Views: 25
  • Filed under category Python
  • Hashtags:

Explanation by: Admin

'r' mode is used to open a file for reading.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.