リンク
ちゃんと調べるときは
http://www.python.jp/doc/release/
Wiki内検索
最近更新したページ
最新コメント
文字コードの判定 by awesome things!
正規表現 by awesome things!
辞書 by stunning seo guys
文字列の16進変換 by check it out
文字コードの変換 by check this out
デバッガ by check this out
サブプロセス by watch for this
文字コードの判定 by watch for this
サニタイジング by check this out
タグ

データ型の判定

取得と判定


>>>
>>> a = "EEECCCAAABBBDDD"
>>> 
>>> tp = type(a)
>>> print tp
<type 'str'>
>>> 
>>> if isinstance(a, str): print "文字列"
... 
文字列
>>> 

isinstanceの二つめの引数は文字列じゃないので注意
2009年04月03日(金) 13:18:38 Modified by hebi_




スマートフォン版で見る