May-06-2019, 02:49 PM
print('Now you are creating your function, when finished type Break') def f(x): total=0 a=0 b=0 while a!='Break' or b!='Break': a=input('Enter the coefficient of X:') b=input('Enter the power of X:') if a=='Break' or b=='Break': return total break else: c=int(a)*x**int(b) total = total+c e=0.00001 x=int(input('Enter the X value:')) r= f((x+e)-f(x))/e print(r, 'is the value of derivative', 'f(x)','for the X value of',x)Purpose of this code is it creates a function from the inputs by the user and finds the value of its derivative for a X value again input by the user.
The problem is that when I type Break to a or b input while loop doesn't break.
I would appreciate any suggestion or help.
Thank you in advance.