- 4
How to write (a)d²
I am stuck in a code i am typing (a)*d**2(i gave the value of a so there is no problem in a)but its showing error
44 Respostas
+ 10
a*(d**2)
+ 5
Jayakrishna🇮🇳 okay...lets try to get Darsh home😊
+ 4
Jayakrishna🇮🇳 lets have a beer😁
+ 4
anil sen this is now the third time I am addressing you to please quit spamming your advertisement.
Thanks and happy coding.
+ 3
if you try to accomplish that: (a) multiplied by squared (b)
try this :
(a*(d**2))
+ 2
Ok
+ 2
x=a*(d**2) 🤔
+ 2
But a should not be squared
+ 2
here we have to remember #precedence and #direction thing before doing the operation.
**precedence of operator
BRACKET-->POWER
**Direction of each operator
1,POWER-- RIGHT TO LEFT
2, BRACKET ...LEFT TO RIGHT
THEN...
a*(d**2)
+ 2
a*d**2
+ 1
Darsh please explain what d should be.
user input?
a variable from 1 to 10?
a certain value?
+ 1
print("the quadratic qequation is ax^2 + bx + c and x ={0}, y= {1}".format(x,y))
Replace this... Is that what you want?
Edit : Darsh i understood now..
You calculated values to x, y then use x, y not d.
Like
print("the quadratic equation is ",(a)*x**2+(b)*x+(c), " satisfied")
print("the quadratic equation is ",(a)*y**2+(b)*y+(c), " satisfied")
+ 1
😂😁😋
+ 1
Oma Falk ha ha.. 🥤
+ 1
Hy Darsh you can write as in your code;
(d*d)*a
+ 1
Try to write like (a*d) ** 2 it will work
+ 1
Hmm it should be a * (d**2)
+ 1
you can check this code if you want best of luck
https://code.sololearn.com/crO6jDtNWAP3/?ref=app
0
Can you show the code...?