2019-02-20
阅读量:
742
Python中的多态性是什么
什么是多态性:多态性这个词意味着有很多形式。在编程中,多态性意味着相同的函数名称(但不同的签名)用于不同的类型。
内置多态函数的示例:
# Python program to demonstrate in-built poly-
# morphic functions
# len() being used for a string
print(len("geeks"))
# len() being used for a list
print(len([10, 20, 30]))
Output:
5
3






评论(0)


暂无数据
推荐帖子
0条评论
0条评论
1条评论