abstract:1、type(變量名),輸出的結果就是變量的類型;例如>>> type(6)<type 'int'>2、在Python里面變量在聲明時,不需要指定變量的類型,變量的類型是動態(tài)指定的;>>> x=5>>> type(x)<type 'int'>>>> x="wan
1、type(變量名),輸出的結果就是變量的類型;
例如
>>> type(6)
<type 'int'>
2、在Python里面變量在聲明時,不需要指定變量的類型,變量的類型是動態(tài)指定的;>>> x=5
>>> type(x)
<type 'int'>
>>> x="wang"
>>> type(x)
<type 'str'>
3、也就是說變量的類型,根據(jù)給出的賦值語句決定(變量的值來決定)。