與python第一次親密接觸!
在網(wǎng)上搜集了很多資料和瀏覽了python的很多相關(guān)文章,它給我的總體感覺(jué)是在文本處理上的高效和語(yǔ)言的"人性化",
面舉個(gè)例子來(lái)說(shuō)明我為什么覺(jué)得"人性化":
1.?Reason?One :??長(zhǎng)整型無(wú)長(zhǎng)度限制,除了電腦硬件的限制
Although both lower case "l" and upper case "L" are allowed as suffix for long integers, it is strongly recommended to always use "L", since the letter "l" looks too much like the digit "1".
Plain integer literals that are above the largest representable plain integer (e.g., 2147483647 when using 32-bit arithmetic) are accepted as if they were long integers instead.
There is no limit for long integer literals apart from what can be stored in available memory.
Some examples of plain integer literals (first row) and long integer literals (second and third rows):???????
7????? 2147483647????????????????????????????????????? 0177
3L??? 79228162514264337593543950336L??? 0377L?? 0x100000000L
?????? 79228162514264337593543950336???????????????? 0xdeadbeef
2.?Reason?Two : (quote)
一個(gè)python小tip,交換兩個(gè)變量的值,而且不使用第三個(gè)變量:
>>> a,b = 1,2
>>> a,b = b,a
>>> a,b
(2, 1)
>>>?
3.Reason Three:
它是用C語(yǔ)言開(kāi)發(fā)的,但是效率比起C語(yǔ)言也差了多少,當(dāng)然沒(méi)C快啦,但是他里面的很多函數(shù)非常方便,功能比C強(qiáng)大很多。
4.Reason Four :
最讓人興奮的原因就是BitComet就是它開(kāi)發(fā)出來(lái)的。
他避免了很多初學(xué)程序設(shè)計(jì)時(shí)常常出現(xiàn)的問(wèn)題,盡管對(duì)于大多數(shù)人來(lái)說(shuō)都是幾乎不會(huì)發(fā)生的,但是從這點(diǎn)可以看出它對(duì)它的用戶是傻瓜開(kāi)始的。因?yàn)樯倒喜艜?huì)犯哪些錯(cuò)誤!
??