The difference between return call with and without parameters

Add parameters


def test(m):

    a =1
    return a+m
def test2():
    m = 5
    s = test(m)
    b=2
    print(s+b)
test2()

No parameters

def test():
    a =1
    return a
def test2():
    s = test()
    b=2
    print(s+b)
test2()

Guess you like

Origin blog.csdn.net/weixin_42540340/article/details/105225937