Q
Q
QweweS2022-04-20 10:03:35
Python
QweweS, 2022-04-20 10:03:35

Python arithmetic expression how to do?

The program calculates the given arithmetic value, given the given variables.
Gives an error message.625fb01ff2585740324123.png

import math
x=float(input("Введите переменуую X:"))
z=float(input("Введите переменуую Z:"))
y=math.atan((x+y)/(math.pi*sin(y)))+math.pow(math.e,4*x)/(x*z)
print("y = {0:.2f}".format(y))


Error -
Traceback (most recent call last):
File "main.py", line 4, in
y=math.atan((x+y)/(math.pi*sin(y)))+math.pow(math .e,4*x)/(x*z)
NameError: name 'y' is not defined

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
Kirill Palchevsky, 2022-04-20
@OffHand1424

NameError: name 'y' is not defined
y=math.atan((x+y)/(math.pi*sin(y)))+math.pow(math.e,4*x)/(x*z )
You assign the variable "y=" to this value "math.atan((x+y)/(math.pi*sin(y)))+math.pow(math.e,4*x)/(x* z)" , however, to calculate the value, you need the variable "y" in it, and there is no such variable yet.
Or an error in the expression:
625fb01ff2585740324123.png
Or you need to immediately remove the "Y" on the right side of the expression and then calculate.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question