Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
所以,如果我在控制台中输入 (4*9j**2),它会返回 (-324+0j)进入控制台(j 充当虚数 i)
提前致谢!
您可以使用内置函数eval()。
>>> 4*9j**2 (-324+0j) >>> equation = "4*9j**2" >>> eval(equation) (-324+0j)