
下面的筆記都在 python console下直接執行:
範例1:整數類型(int)
>>> a=100
>>> type(a)
執行結果:<class 'int'>
範例2:浮點數類型(float)
>>> b=3.1415
>>> type(b)
執行結果:<class 'float'>
範例3:布林值類型(bool)
>>> c=True
>>> type(c)
執行結果:<class 'bool'>
範例4:字串類型(str)
>>> d='Python 是一門容易學的電腦程式語言'
>>> type(d)
執行結果:<class 'str'>
範例5:串列類型(list):串列是一種容器類型 的資料型態
>>> e=['Python','C','C++','Java','C#']
>>> type(e)
執行結果:<class 'list'>