-3

I want to find the absolute value of something like 'i' but when I type 'abs(1)' it says 'i' is not defined. What do I do?

1 Answers1

1

In python to find the absolute value of a complex function you use j instead of i.

abs(a+bj) # General Format
abs(0+1j)
>> 1

Or you could define i as the square root of -1 and use it instead

i = (-1) ** 0.5
abs(i)
>> 1
Imaad F
  • 128
  • 8