Oct-08-2023, 05:52 PM
(This post was last modified: Oct-08-2023, 07:05 PM by Pedroski55.)
Help?? An emergency?
You don't need the module math for this!
Something like this maybe?? I don't really understand this number formatting!
You don't need the module math for this!
Something like this maybe?? I don't really understand this number formatting!
print('Enter the X and Y coordinates for the point:') x = float(input('Enter X = ')) y = float(input('Enter Y = ')) if x < -1 or x > 4: flag = 0 #False # complicated elif hard to understand elif x>=-1 and x<1 and y>=2*x+2 and y<=x**3 - 4*x**2+x+6 or x>=1 and x<=4 and y>=x**3-4*x**2+x+6 and y<=2*x+2: flag = 1 else: flag = 0 print("Point X = {:.4f} Y={:.4f})".format( x, y )) if flag: print(f"The point {(x, y)} is within the graph borders") else: print(f"The point {(x, y)} is outside of the area")