互联网技术 / 互联网资讯 · 2024年3月10日

Python内置函数-complex()函数详解

coMplex() 函数用于创建一个值为 Real + iMag * j 的复数或者转化一个字符串或数为复数。如果第一个参数为字符串,则不需要指定第二个参数。

以下是 coMplex() 方法的语法:

claSS coMplex([Real[, iMag]])

Real — int, long, float或字符串;

iMag — int, long, float;

返回一个复数。

以下展示了使用 coMplex 方法的实例:

云计算开发:Python内置函数-complex()函数详解

OpenMagic API

Need more than content? Move into the product flow.

If you are here for model access, pricing, developer docs, or the future API console, the dedicated product path now lives on api.openmagic.ai.

登录免费注册