arrays and plotting exampleplotting user-specified function say we want to write small program plotf py that asks the user to provide mathematical function ( )and then plots the curve (xwe can also ask the user to specify the boundaries of the curvethat isthe lower and upper limits for an example of running the program from the terminal can look like should be terminal terminalpython plot_input py write mathematical expression of : * ** - provide lower bound for : provide upper bound for : for these input values the program should plot the curve for [ the plot_input py program should work for any mathematical expression the task can be solved using the the functions input and eval introduced in from numpy import import matplotlib pyplot as plt formula input('write mathematical expression of :'xmin float(input('provide lower bound for :')xmax float(input('provide upper bound for :') linspace(xminxmax eval(formulaplt plot(xyplt show(this small program will stop and ask the user first for mathematical expression and then for the bounds on xand then it will proceed to plot the resulting curve note thatin this casewe have good reason to import numpy with from numpy import we want the user to be able type formula using standard mathematical terminologysuch as sin(xx** (rather than np sin(xx** for this to workwe need to import all the mathematical functions from numpy without prefix plotting discontinuous and piecewise-defined functions discontinuous functionsand functions defined in piecewise mannerare common in science and engineering we saw in how these could be implemented in python using if-testsbutas we briefly commented abovethis implementation gives rise to challenges when using arrays and numpy