πŸ“Š Python
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
πŸ’¬ Discuss
βœ… Correct Answer: (B) 5

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

Explanation by: Mr. Dubey
tell() returns the current position which is the number of characters written.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
44
Total Visits
πŸ“½οΈ
8 mo ago
Published
πŸŽ–οΈ
Mr. Dubey
Publisher
πŸ“ˆ
81%
Success Rate