I'm new to python, sorry if this seems awfully rudimentary for some. I know complex numbers can be simply represented using j after an integer e.g.
a = 2 + 5j
However when I try something like the code below, python returns an error and doesn't recognise this as being complex?
x = 5
a = 2 + xj
Similarly this doesn't work:
a = 2 + x*j
How can I get around this problem. I'm trying to use this principle is some larger bit of code.
a = 2 + x*1jor use cmath