问答详情
源自:2-2 Python类的定义与实例化

为什么输入后显示运行失败

class Animal(object):  pass dog = Animal() cat = Animal() print(dog) print(cat) print(dog == cat)

提问者:20044031 2021-01-20 21:15

个回答

  • 有李走天下
    2021-01-21 17:20:03
    已采纳

    注意换行

  • qq_慕斯卡4503874
    2022-05-26 23:08:33

    class Animal(object):

        pass

    dog = Animal()

    cat = Animal()

    print(dog)

    print(cat)

    print(dog == cat)


  • qq_慕仰7097625
    2021-03-28 10:34:51

    去他喵的python