1.

型の確認

編集

これはPythonの型の確認に関する記事です。

 

type関数を使用することで型を確認することが出来ます。

 

【型の確認プログラム】

print(type(100));

print(type(1.0));

print(type("abc"));

print(type(1==1));

 

【出力結果】

<class 'int'>

<class 'float'>

<class 'str'>

<class 'bool'>

編集
Post Share
子ページ

子ページはありません

同階層のページ
  1. 型の確認
  2. strからintへの型変換
  3. 辞書型を文字列に変換する方法