Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Python by (2.6k points)

I came across the term duck typing while reading random topics on software online and did not completely understand it.

What is “duck typing” somebody explain?

1 Answer

0 votes
by (7.2k points)

Duck typing is a concept related to dynamic typing, where the type or the class of an object is less important than the methods it defines. When you use duck typing, you do not check types at all. Instead, you check for the presence of a given method or attribute.

Related questions

0 votes
1 answer
0 votes
1 answer
asked Mar 1, 2021 in Python by Rekha (2.2k points)
0 votes
1 answer
asked Dec 16, 2020 in Python by Rekha (2.2k points)

Browse Categories

...