[oeasy]python0045_轉(zhuǎn)化為10進(jìn)制數(shù)_int_integrate_integer_entire_整數(shù)
轉(zhuǎn)化為10進(jìn)制
回憶上次內(nèi)容
上這次總結(jié)了四種進(jìn)制
函數(shù)名對(duì)應(yīng)單詞進(jìn)制類型數(shù)字事例前綴bin()binary20b11000010boct()octal80o1410ohex()hexadecimal160x610x?decimal1097無(wú)
十進(jìn)制數(shù)
其他進(jìn)制 的 字符串狀態(tài)
可以轉(zhuǎn)化 為
那反過(guò)來(lái)
可以轉(zhuǎn)化
回
10進(jìn)制嗎???其他進(jìn)制形態(tài)的字符串
轉(zhuǎn)回
10進(jìn)制
可以用 int 函數(shù)

這個(gè) int
什么
來(lái)歷?
int 函數(shù)
help(int)

int
整數(shù)
來(lái)自于integer
可以 把字符串
轉(zhuǎn)化為
整數(shù)
嗎?
int("011")
確實(shí)可以 將其他進(jìn)制形態(tài)的字符串
轉(zhuǎn)化為
整數(shù)

但是要加上
base=0
這樣的參數(shù)base 可以 設(shè)置為
2
么?
base=2
base
基礎(chǔ)
這里指的是基數(shù)
基數(shù)為2
就是 二進(jìn)制的數(shù)
base=
2
理解字符串
就是 用
二進(jìn)制
的方式

基數(shù)base 可以
不是常見(jiàn)的2、8、10、16嗎?
特殊 基數(shù)
只要設(shè)置好 base就可以

如何理解 函數(shù)int 所對(duì)應(yīng)的
integer這個(gè)詞呢?
integer(整型)
integer 意思是整的
和零散相反

integer
*tag-
touch
接觸過(guò)
沒(méi)有
in
teger
interger 是完整的
類似的單詞還有 integral
integral
integral ?[??nt?ɡr?l]
完整的; 不可或缺的; 必需的; 作為組成部分的; 完備的;
integral calculus 積分運(yùn)算
integrality
完整性;完全;圓滿;
integrant
構(gòu)成整體的; 要素;組成部分;
integrate
Integrated Circuit Chip
把分立件集成到一塊電路板上
整合
集成電路芯片 ICC

integrate
又可以派生有一系列單詞
integrate
reintegrate
重返; 重建
integration
結(jié)合; 整合; 融合
disintegrate
分解; 瓦解; 解體; 碎裂; 分裂; 崩潰; 衰微
disintegration
崩解; 瓦解

integrity
誠(chéng)實(shí)正直; 完整; 完好;
發(fā)音不斷變化
單詞也不斷出現(xiàn)
integrate 和 entire 也是 同源的
entire
entire [en?tair]
完整的
entire wheat flour 全麥粉
entirely
完全; 全部地; 完整地
entirety
整體性

仔細(xì)想想 這些單詞 其實(shí)是一個(gè)
只是 不同口音
落實(shí)到 拼音字母就成了 不同的單詞
不禁 感謝我們的象形文字
雖然 符號(hào)數(shù)量 比英文多得多
但是 原始含義 很清晰
int函數(shù) 還有取整的意思
具體怎么
取整
呢?
總結(jié)
這次 把其他進(jìn)制
用的是 int 函數(shù)
轉(zhuǎn)化回
十進(jìn)制
int 來(lái)自于 integer
integrate
entire
意思都是
完整
的同源詞 還有
完整
的 和零散
的相對(duì)
可以把
零散
的小數(shù)轉(zhuǎn)化為
完整
的整數(shù)嗎???我們下次再說(shuō)!??
藍(lán)橋->https://www.lanqiao.cn/courses/3584
github->https://github.com/overmind1980/oeasy-python-tutorial
gitee->https://gitee.com/overmind1980/oeasypython
視頻->https://www.bilibili.com/video/BV1CU4y1Z7gQ 作者:oeasy