- Learn Python in 7 Days
- Mohit Bhaskar N. Das
- 139字
- 2021-07-09 20:40:24
Complex numbers
A complex number has both real and imaginary parts, and Python allows you to specify this data type in a very easy and convenient way.
Syntax:
<variable name>=complex(x,y)
OR
<variable name>=x+yj
Here, x is the real part and y is the imaginary part. Here, j plays the role of iota.
It will be clearer with the following screenshot:

Here, we declare two variables to denote complex numbers. One way to achieve is to use complex() method and the other way is to use the standard notation as used in mathematics.
In standard complex number notation, x+ij, i is used to denote the starting of the imaginary part and stands for iota. j denotes the imaginary part. The credit for conceiving the idea of complex numbers goes to Italian mathematician Gerolamo Cardano in 1545.
Source: https://en.wikipedia.org/wiki/Complex_number
Source: https://en.wikipedia.org/wiki/Complex_number
推薦閱讀
- Modular Programming with Python
- C# 2012程序設計實踐教程 (清華電腦學堂)
- Java虛擬機字節(jié)碼:從入門到實戰(zhàn)
- Python應用輕松入門
- Java程序設計與實踐教程(第2版)
- Flutter跨平臺開發(fā)入門與實戰(zhàn)
- HTML5 APP開發(fā)從入門到精通(微課精編版)
- ElasticSearch Cookbook(Second Edition)
- Exploring SE for Android
- OpenCV Android Programming By Example
- UI動效設計從入門到精通
- Scratch編程從入門到精通
- iOS Development with Xamarin Cookbook
- Managing Windows Servers with Chef
- Java核心技術速學版(第3版)