问答详情
源自:3-3 Python判断类型

isinstancd()怎么用?

isinstance(t , Pserson)

提问者:qq_慕斯卡7441780 2021-05-19 09:21

个回答

  • weixin_慕哥4444959
    2021-09-03 16:15:07

    isinstance(t,Person)

    print(isinstance(t,Person))

    isinstance(t,Student)

    print(isinstance(t,Student))

    isinstance(t,Teacher)

    print(isinstance(t,Teacher))


    True

    False

    True


  • qq_hush_ceklpC
    2021-07-23 23:23:51

    print(isinstance(t , Pserson))

  • 三碗灬不过岗
    2021-05-20 16:41:27

    就是这样用,然后打印出来