Plz solve this errors | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
14th Nov 2019, 10:07 AM
Satya Chaitanya Yerninti
Satya Chaitanya Yerninti - avatar
2 Answers
+ 5
The expression you have inside math.sqrt is negative
14th Nov 2019, 10:13 AM
Aymane Boukrouh
Aymane Boukrouh - avatar
+ 3
Hi, I had a look at your code, and I just ask myself if it solves a real world problem, or if it's just playing with some numbers. * What is the expected result of the code? * Did you try to cut it in smaller pieces and try to calculate it and solve the issue? * Did you check if all parentheses are in place? Dependent on how parenthesis are placed, it does work, but as I have no glue what purpose this code has, it's all guessing. This does work: print(math.sqrt(math.pow(2,x)) * (math.log(y,(2*x)+y) - math.pow(3,y)) * (math.log(x,(x*y-1)))) # Output: -22.770235671082496
14th Nov 2019, 12:43 PM
Lothar
Lothar - avatar