Math domain error | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Math domain error

I am wrote code and i am had an a error, "Math domain error", why? How to fix it? https://code.sololearn.com/cU7NtZgaY2d2/?ref=app

24th Mar 2022, 8:35 AM
MeGaN
1 Answer
+ 1
it's because : list.append(num-i) will result in negative numbers num2 is negative by the last assignment, math.sqrt(num2) is a complex number.
24th Mar 2022, 8:48 AM
Bahhaⵣ
Bahhaⵣ - avatar