complex()
Built-in FunctionPython 2.0+Intermediate
Creates a complex number (e.g. 3+4j)
Quick Info
- Documentation
- Official Docs
- Python Version
- 2.0+
Learn by Difficulty
Quick Example
python
c = complex(3, 4) print(c) print(abs(c))
complex() is a built-in function that creates a complex number (e.g. 3+4j).
Try in PlaygroundTags
builtinfunctioncoredatatypenumericmath