How to write (a)d² | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
- 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

14th Aug 2020, 6:17 PM
Darsh
Darsh - avatar
44 Answers
+ 10
a*(d**2)
15th Aug 2020, 12:23 PM
Alpa
Alpa - avatar
+ 5
Jayakrishna🇮🇳 okay...lets try to get Darsh home😊
14th Aug 2020, 6:40 PM
Oma Falk
Oma Falk - avatar
+ 4
Jayakrishna🇮🇳 lets have a beer😁
14th Aug 2020, 7:05 PM
Oma Falk
Oma Falk - avatar
+ 4
anil sen this is now the third time I am addressing you to please quit spamming your advertisement. Thanks and happy coding.
16th Aug 2020, 6:41 AM
BroFar
BroFar - avatar
+ 3
if you try to accomplish that: (a) multiplied by squared (b) try this : (a*(d**2))
15th Aug 2020, 3:57 PM
Farhad Baghban Ahangar
Farhad Baghban Ahangar - avatar
+ 2
Ok
14th Aug 2020, 6:19 PM
Darsh
Darsh - avatar
14th Aug 2020, 7:01 PM
Oma Falk
Oma Falk - avatar
+ 2
x=a*(d**2) 🤔
15th Aug 2020, 5:26 AM
Sanjay Kamath
Sanjay Kamath - avatar
+ 2
But a should not be squared
15th Aug 2020, 1:58 PM
Darsh
Darsh - avatar
+ 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)
15th Aug 2020, 9:33 PM
I C
I C - avatar
+ 2
a*d**2
16th Aug 2020, 1:14 AM
S.G.INGALE
S.G.INGALE - avatar
+ 1
Darsh please explain what d should be. user input? a variable from 1 to 10? a certain value?
14th Aug 2020, 6:41 PM
Oma Falk
Oma Falk - avatar
+ 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")
14th Aug 2020, 6:58 PM
Jayakrishna 🇮🇳
+ 1
😂😁😋
14th Aug 2020, 7:06 PM
Darsh
Darsh - avatar
+ 1
Oma Falk ha ha.. 🥤
14th Aug 2020, 7:10 PM
Jayakrishna 🇮🇳
+ 1
Hy Darsh you can write as in your code; (d*d)*a
15th Aug 2020, 1:50 PM
Suthar Vivek
+ 1
Try to write like (a*d) ** 2 it will work
15th Aug 2020, 1:57 PM
Merdan Atamyradow
Merdan Atamyradow - avatar
+ 1
Hmm it should be a * (d**2)
15th Aug 2020, 2:00 PM
Merdan Atamyradow
Merdan Atamyradow - avatar
+ 1
you can check this code if you want best of luck https://code.sololearn.com/crO6jDtNWAP3/?ref=app
16th Aug 2020, 2:01 AM
Deepak Jaiswar
Deepak Jaiswar - avatar
0
Can you show the code...?
14th Aug 2020, 6:19 PM
Jayakrishna 🇮🇳