print(x) 
    print(y)
    plt.plot(y,x,'b--')
    plt.savefig('line.png')
    plt.show()



Note here The output of the function was not an array nor a variable. it simply a plot saved in a figure. The output of your function can also be simply a plot or a print statement.