python中

python中,第1张

作用:可以不用 . 就调用
class Person:
    def __call__(self, name):
        print("__call__"+"hello"+name )

    def hello(self,name):
        print("hello"+name)

person = Person()
person("zhangsan")
person.hello("lisi")

欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/langs/873551.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-05-13
下一篇2022-05-13

发表评论

登录后才能评论

评论列表(0条)

    保存