A

Admin • 832.27K Points
Coach

Q. What will this code snippet output?
file = open('file.txt', 'w')
file.write('Hello')
print(file.tell())

Code:
file = open('file.txt', 'w')
file.write('Hello')
print(file.tell())
  • (A) 0
  • (B) 5
  • (C) Hello
  • (D) Error
  • Correct Answer - Option(B)
  • Views: 26
  • Filed under category Python
  • Hashtags:

Explanation by: Admin

tell() returns the current position which is the number of characters written.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.