On This Page

This set of Problem Solving and Python Programming Multiple Choice Questions & Answers (MCQs) focuses on Problem Solving And Python Programming Set 17

Q1 | Which function is used to read all the characters?
Q2 | Which function is used to read single line from file?
Q3 | Which function is used to write all the characters?
Q4 | Which function is used to write a list of string in a file?
Q5 | Which function is used to close a file in python?
Q6 | Is it possible to create a text file in python?
Q7 | Which of the following are the modes of both writing and reading in binary format in file?
Q8 | Which of the following is not a valid mode to open a file?
Q9 | What is the difference between r+ and w+ modes?
Q10 | How do you get the name of a file from a file object (fp)?
Q11 | Which of the following is not a valid attribute of a file object (fp)?
Q12 | How do you close a file object (fp)?
Q13 | How do you get the current position within the file?
Q14 | How do you rename a file?
Q15 | How do you delete a file?
Q16 | How do you change the file position to an offset value from the start?
Q17 | What happens if no arguments are passed to the seek function?
Q18 | Which function overloads the + operator?
Q19 | Which function overloads the == operator?
Q20 | Which operator is overloaded by     lg    ()?
Q21 | Which function overloads the >> operator?
Q22 | Let A and B be objects of class Foo. Which functions are called when print(A + B) is executed?
Q23 | Which function overloads the // operator?
Q24 | How many except statements can a try- except block have?
Q25 | When is the finally block executed?