On This Page

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

Q1 | Which of the following are the modes of both writing and reading in binary format in file?
Q2 | Which of the following is not a valid mode to open a file?
Q3 | What is the difference between r+ and w+ modes?
Q4 | How do you get the name of a file from a file object (fp)?
Q5 | Which of the following is not a valid attribute of a file object (fp)?
Q6 | How do you close a file object (fp)?
Q7 | How do you get the current position within the file?
Q8 | How do you rename a file?
Q9 | How do you delete a file?
Q10 | How do you change the file position to an offset value from the start?
Q11 | What happens if no arguments are passed to the seek function?
Q12 | Which function overloads the + operator?
Q13 | Which function overloads the == operator?
Q14 | Which operator is overloaded by     lg    ()?
Q15 | Which function overloads the >> operator?
Q16 | Let A and B be objects of class Foo. Which functions are called when print(A + B) is executed?
Q17 | Which function overloads the // operator?
Q18 | How many except statements can a try- except block have?
Q19 | When is the finally block executed?
Q20 | k = foo() print(k)
Q21 | What happens when ‘1’ == 1 is executed?
Q22 | g=f(8) print(next(g))
Q23 | Which of the following is not an exception handling keyword in Python?
Q24 | )) type(g)
Q25 | ]