Skip to content
Question

Q.The correct syntax of tell() is :

(a) tell.file_object()
(b) file_object.tell()
(c) tell.file_object(1)
(d) file_object.tell(1)
CBSECBSE Class XII Board 2023MCQ· 1mImportance★★★★★
🔒 Locked · start free trial →

You're viewing a preview — the full solution, concept, methods & PYQ mapping are locked.

Start your 14-day free trial to unlock the full solution →

In Python file handling, the tell() method is called on a file object using dot notation, with no arguments — the correct syntax is file_object.tell().

When you work with files in Python, you are essentially moving a cursor through a stream of data. Every time you read or write, that cursor advances. The tell() method is the tool that tells you exactly where that cursor is at any moment — it returns the current position (as an integer representing bytes from the beginning of the file).

The syntax follows the standard object-oriented pattern in Python. A file object — created by open() — has methods attached to it. You access those methods by writing the object's name, a dot, and then the method name. So file_object.tell() is the correct form. No argument is needed inside the parentheses because tell() simply reports the current position; it does not change it.

Note

The position returned by tell() is measured in bytes, not characters. For text files, this distinction matters when the file uses multi-byte encodings like UTF-8 — but for most exam purposes, you can treat it as the cursor's offset from the start.

Now look at the options given:

  • (a) tell.file_object() — This is wrong because it treats tell as if it were the object and file_object as a method. In Python, the object comes first, then the dot, then the method.
  • (b) file_object.tell() — This is correct. The file object is the thing that knows its position, and tell() is the method that asks it. …

Unlock everything free for 14 days

  • Full step-by-step solutions
  • Concept-first explanations
  • Methods, shortcuts & mistakes
  • PYQ mapping + timed mock tests

Full access for 14 days. No credit card required.