search

Home  >  Q&A  >  body text

python3.x - python中一个函数如何调用另一个函数的返回值?

PHPzPHPz2771 days ago598

reply all(1)I'll reply

  • 阿神

    阿神2017-04-17 16:09:49

    def test():
        num  = 0
        num += 1
        return num
        
    def test2():
        new_num = test()
        print test()

    You can directly reference the function name test(), or assign it to other variables: new_num = test().

    reply
    0
  • Cancelreply