ExamVeda
Login
Home
71
How do you change the file position to an offset value from the start?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
72
How can you open a file for both reading and writing in Python?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
73
What is the difference between r+ and w+ modes?
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
74
What is the purpose of the b mode when opening a file in Python?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
75
What is the output of the following code:
with open('data.txt', 'r') as file:
lines = file.read().splitlines()
print(len(lines))
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
76
What is the current syntax of rename() a file?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
77
What will be the output of the following Python code?
fo = open("foo.txt", "wb")
print "Name of the file: ", fo.name
fo.flush()
fo.close()
Discuss
Answer & Solution
Answer: Option D
No explanation is given for this question. Let's Discuss on Board
78
What is the correct syntax of open() function?
Discuss
Answer & Solution
Answer: Option B
No explanation is given for this question. Let's Discuss on Board
79
What is the purpose of the readlines() method in file handling?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board
80
Is it possible to create a text file in python?
Discuss
Answer & Solution
Answer: Option A
No explanation is given for this question. Let's Discuss on Board