Issue
The question and my problem is as follows;
define a python function f(x) = ln(x) + x^2 - 1 and print the output for f(1.00001), f(0.5) and f(10^-10)
I can print the output for each of these separately but can't produce it so that I can print the 3 outputs in the same cell without producing 3 separate cells with the 3 values of x.
My code is currently as follows:
import numpy as np
def f(x):
y = np.log(x) + x**2 - 1
return y
x = 0.5
f(x)
Solution
In Jupyter Notebook, you should be able to print out any number of print statements in a sequence and they will all appear in one output cell:
Answered By - dsillman2000
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.