與python第一次親密接觸!
在網上搜集了很多資料和瀏覽了python的很多相關文章,它給我的總體感覺是在文本處理上的高效和語言的"人性化",
面舉個例子來說明我為什么覺得"人性化":
1.?Reason?One :??長整型無長度限制,除了電腦硬件的限制
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)
一個python小tip,交換兩個變量的值,而且不使用第三個變量:
>>> a,b = 1,2
>>> a,b = b,a
>>> a,b
(2, 1)
>>>?
3.Reason Three:
它是用C語言開發的,但是效率比起C語言也差了多少,當然沒C快啦,但是他里面的很多函數非常方便,功能比C強大很多。
4.Reason Four :
最讓人興奮的原因就是BitComet就是它開發出來的。
他避免了很多初學程序設計時常常出現的問題,盡管對于大多數人來說都是幾乎不會發生的,但是從這點可以看出它對它的用戶是傻瓜開始的。因為傻瓜才會犯哪些錯誤!
??