abs(number):返回數字的絕對值.如abs(-3)=3;
cmatch.sqrt(number):返回平方根,也可以返回負數
float(object):將字符串和數字轉換爲浮點數 float(3)=3.0
help():提供交互式幫助
input(”提示信息"):獲取用戶輸入,但只能輸入數字,如果要輸入字符中,手動加上雙引號
int(object):將字符串或者數字轉換爲整數int(3.2)=3;int(3.9)=3;int(-3.2)=-3;int(-3.9)=-3;捨去小數位,只取整數位
long(object):將字符串或者數字轉換爲長整數,long(3)=3L,如果有小數,捨去小數位,只取整數位,負數一樣
math.ceil(number):返回數的上入整數,近回值類型爲浮點數如:math.ceil(12.1)=13.0,math.ceil(-12.1)=-12.0,math.ceil(-12.9)=-12.0,
math.floor(number):返回數的下入整數,近回值類型爲浮點數如:math.floor(12.9)=12.0,math.floor(-12.1)=-13.0,math.floor(-12.9)=-13.0
math.sqrt(number):近觀回平方根,不適就負數math.sqrt(4)=2.0
pow(x,y):x表示底數,y表示次方數,近觀回x的y次方.pow(2,2)=4,pow(2,-2)=0.25
raw_input(”提示信息"):獲取用戶輸入,返回值類型爲字符串
repr(object):返回值的字符串表示形式,只是形式,並沒有轉換
round(x,y):根所給定精度進行四捨五入x,是運算數,y是精度.
round(11.5)=12,round(-11.5)=-11,
round(14.5,-1)=10,round(-14.5,-1)=-20,
round(16.5,-1)=20,round(-16.5,-1)=-20,
round(56.5,-2)=100,round(-56.5,-2)=-100
str(object):將值轉換爲字符串