def test1():
a=1
b=2
c=3
dict={'v1':a,'v2':b,'v3':c}
return dict
def test2():
x=test1().get('v1')
print(f'{x}是test1函数中的值')
if __name__ == '__main__':
test2()
运行结果:1是test1函数中的值
def test1():
a=1
b=2
c=3
list=[a,b,c]
return list
def test2():
x=[5,6]
y=test1()
x.append(y)
print(f'{x}是整合test1函数中的第一个值')
if __name__ == '__main__':
test2()
运行结果:[5, 6, [1, 2, 3]]是整合test1函数中的第一个值