import 其它檔案的函式

test2.py 內容如下:

1
2
def add(x, y):
    return x + y

test1.py 內容如下

1
2
3
4
import test2

result = test2.add(10, 20)
print(result)
30

results matching ""

    No results matching ""