Computer Science
Which of the following functions changes the position of file pointer and returns its new position?
- flush()
- tell()
- seek()
- offset()
Python File Handling
1 Like
Answer
seek()
Reason — The seek() function in Python is utilised to relocate the file pointer within a file to a specific position. It also accepts an optional second argument, which denotes the starting point for determining this new position.
Answered By
3 Likes
Related Questions
Which of the following statements is FALSE about keys in a relational database?
- Any candidate key is eligible to become a primary key.
- A primary key uniquely identifies the tuples in a relation.
- A candidate key that is not a primary key is a foreign key.
- A foreign key is an attribute whose value is derived from the primary key of another relation.
Fill in the blank:
In case of …………… switching, before a communication starts, a dedicated path is identified between the sender and the receiver.
Assertion(A): List is an immutable data type.
Reasoning(R): When an attempt is made to update the value of an immutable variable, the old variable is destroyed and a new variable is created by the same name in memory.
- Both A and R are true, and R is the correct explanation of A.
- Both A and R are true, and R is not the correct explanation of A.
- A is true but R is false.
- A is false but R is true.
Assertion(A): Python Standard Library consists of various modules.
Reasoning(R): A function in a module is used to simplify the code and avoids repetition.
- Both A and R are true, and R is the correct explanation of A.
- Both A and R are true, and R is not the correct explanation of A.
- A is true but R is false.
- A is false but R is true.