Mastering Python Quiz Questions and Answers

What is called when a function is defined inside a class?

Answer :
  • Method

Which of the following is an invalid statement?

Answer :
  • x y z = 1 2 3

Which of the following is not a keyword?

Answer :
  • Open

What are the methods which begin and end with two underscore characters?

Answer :
  • Special methods

Which of the following best describes inheritance?

Answer :
  • Ability of a class to derive members of another class as a part of its own definition

What does the built-in function type do in the context of classes?

Answer :
  • Determines the class name of any value

What is the maximum possible length of an identifier?

Answer :
  • 79 characters

Suppose t = (1, 2, 4, 3), which of the following is incorrect?

Answer :
  • t[3] = 45

Which of the following is a Python tuple?

Answer :
  • (1, 2, 3)

Which of the following option is not a core data type in the python language?

Answer :
  • Class