1. Home
  2. Data Science
  3. Python
  4. What is duck typing in Python?

Added 25 Nov 2026

What is duck typing in Python?

  1. Declaring types explicitly
  2. Casting to a class
  3. Using an object based on its behaviour rather than its type Correct answer
  4. A type of inheritance

Correct answer

C. Using an object based on its behaviour rather than its type

6 views

MCQSEXAM

Explanation

If it walks like a duck and quacks like a duck, it is treated as a duck.

Reference

Asked in: Python Interview OOP

https://docs.python.org/3/tutorial/classes.html

Preparing for an exam?

Doubts & discussion

Not sure why the answer is C? Ask here and get an explanation.

Ask a doubt about this MCQ

Shown after review. No links please.

More Python MCQs

Practise all Python MCQs

Similar MCQs