点击运行
import numpy as np def my_func(): return np.array(['a', 'b', 'c', 'd']) a, d = my_func()[[0, 3]] print(a) # 'a' print(d) # 'd'
运行结果 :
正在执行...