[Python] 型の検査・判定
公開日:
        
        :
                
        python        isinstance, python, 型判定        
      
Pythonでの型の検査・判定方法
isinstance
| 1 | isinstance([変数名], [型名]) | 
サンプル
| 1 2 | i = 0 print isinstance(i, int) | 
結果
| 1 | True | 
補足
型には、int, list, dist, strなどいろいろ使えます。
スポンサードリンク
関連記事
-  
                              
- 
              [python] ファイルの読み込みpythonでのファイルの読み込み方法 基本サンプル CSVファイルの読み込み 
-  
                              
- 
              pythonでstorage transfer serviceを使ってみた。準備 pythonのインストールとかする。 このあたり。http://kei0310. 
-  
                              
- 
              [Python] Nullの判定方法(None)Nullの判定方法(None) 表記方法 Pythonでは、Nullを「None」と表記します。 
-  
                              
- 
              [python] 文字列結合pythonでの文字列結合 サンプル 
-  
                              
- 
              Compute Engine(GCE)にpyenv環境を作ってみたpyenvのインストール 必要なOSモジュールのインストール https:// 
-  
                              
- 
              [python] 日付の取り扱い(datetime) 現在日付、計算、文字列変換(format)現在日付 日付の計算 [crayon-6904729e97f57339846537/] 文 
-  
                              
- 
              [python] 配列の扱い方pythonでの配列の扱い方 python 配列の作成 python 配 


