- Python Data Structures and Algorithms
- Benjamin Baka
- 102字
- 2021-07-09 19:45:02
Numeric Types
All numeric types, apart from bool, are signed and they are all immutable. Booleans have two possible values, True and False. These values are mapped to 1 and 0, respectively. The integer type, int, represents whole numbers of unlimited range. Floating point numbers are represented by the native double precision floating point representation of the machine. Complex numbers are represented by two floating point numbers. They are assigned using the j operator to signify the imaginary part of the complex number, for example:
a = 2+3j
We can access the real and imaginary parts with a.real and a.imag, respectively.
推薦閱讀
- Implementing Modern DevOps
- Mastering Visual Studio 2017
- What's New in TensorFlow 2.0
- Java面向對象思想與程序設計
- 自己動手實現Lua:虛擬機、編譯器和標準庫
- MySQL 8從入門到精通(視頻教學版)
- Linux核心技術從小白到大牛
- C語言最佳實踐
- jQuery從入門到精通 (軟件開發視頻大講堂)
- The HTML and CSS Workshop
- Create React App 2 Quick Start Guide
- 愛上micro:bit
- 高質量程序設計指南:C++/C語言
- 計算機視覺實戰:基于TensorFlow 2
- 像程序員一樣使用MySQL