- Mastering Python Scripting for System Administrators
- Ganesh Sanjiv Naik
- 93字
- 2021-07-02 14:00:19
Number type conversion
In some situations, you need to convert a number explicitly from one type to another to satisfy some requirements. Python does this internally in an expression
- Type int(a) to convert a into an integer
- Type float(a) to convert a into a floating-point number
- Type complex(a) to convert a into a complex number with real part x and imaginary part zero
- Type complex(a, b) to convert a and b into a complex number with real part a and imaginary part b. a and b are numeric expressions
推薦閱讀
- Visual C++串口通信開發入門與編程實踐
- MATLAB應用與實驗教程
- 游戲程序設計教程
- Java軟件開發基礎
- Python Data Analysis(Second Edition)
- Linux命令行與shell腳本編程大全(第4版)
- 深入RabbitMQ
- Getting Started with NativeScript
- ANSYS Fluent 二次開發指南
- MongoDB,Express,Angular,and Node.js Fundamentals
- PHP編程基礎與實例教程
- 用戶體驗可視化指南
- Statistical Application Development with R and Python(Second Edition)
- Node.js開發指南
- 細說Python編程:從入門到科學計算