iT邦幫忙

第 11 屆 iThome 鐵人賽

DAY 24
0
Google Developers Machine Learning

Python + 機器學習/深度學習小筆記系列 第 24

[Day - 24]Python+AI從入門到精通(Python數字類型-Number)

在Python 3中,支持的數字類型有
int--整數型
float--浮點型
bool--布林型
complex--複數

https://ithelp.ithome.com.tw/upload/images/20190925/20119675q3VleamYhL.jpg

num1=2  #整數型
num2=0b101  #二進位制 b=binary
num8=0o24  #八進位制 o=Octal
num16=0x3F  #十六進制  x=Hexadecimal,Hex
float_num1=2.345
float_num2=1.23e9

b_var1=True
b_var2=False
b_var3=true  #錯誤,因為Python 3 大小寫很敏感
c_num=complex(3,4)  #複數
type(c_num)
type(b_var1)

https://ithelp.ithome.com.tw/upload/images/20190925/20119675EHsL5VRCd6.jpg
https://ithelp.ithome.com.tw/upload/images/20190925/20119675QrJ5x0ms9p.jpg
https://ithelp.ithome.com.tw/upload/images/20190925/20119675fmhOmhLaSI.jpg
https://ithelp.ithome.com.tw/upload/images/20190925/20119675mEnNtHK8N2.jpghttps://ithelp.ithome.com.tw/upload/images/20190925/20119675WIVNKS7G8h.jpg
https://ithelp.ithome.com.tw/upload/images/20190925/20119675Ubm9aBQWlM.jpg


上一篇
[Day - 23]Python+AI從入門到精通(Python基礎編程-變數)
下一篇
[Day - 25]Python+AI從入門到精通(Python基礎編程-字符串)
系列文
Python + 機器學習/深度學習小筆記30
圖片
  直播研討會
圖片
{{ item.channelVendor }} {{ item.webinarstarted }} |
{{ formatDate(item.duration) }}
直播中

尚未有邦友留言

立即登入留言