《python函數每日一講》專題上周一直在和大家分享python的內建函數,都是按照字母排序來講解的,但是上周講解的4個函數都是不太常用的,今天我很高興,呵呵,因為今天我要和大家分享一個很常用的函數:bin()函數bin(x)英文說明:Convert an integer number to a binary string. The result is a valid Python expression. If x is not a Python int object, it has to
bool([x])英文說明:Convert a value to a Boolean, using the standard truth testing procedure. If x is false or omitted, this returns False; otherwise it returns True. bool is also a class, which is a subclass of int. Class bool cannot be subclassed
callable(object)中文說明:檢查對象object是否可調用。如果返回True,object仍然可能調用失敗;但如果返回False,調用對象ojbect絕對不會成功。注意:類是可調用的,而類的執行個體實現了__call__()方法才可調用。版本:該函數在python2.x版本中都可用。但是在python3.0版本中被移除,而在python3.2以後版本中被重新添加。英文說明:Return True if the object argument appears callable,
chr(i)中文說明:返回整數i對應的ASCII字元。與ord()作用相反。參數x:取值範圍[0, 255]之間的正數。版本:該函數在python2和python3各個版本中都可用。不存在相容性問題。英文說明:Return a string of one character whose ASCII code is the integer i. For example, chr(97) returns the string 'a'. This is the inverse of