infoMore than 1 year has passed since last update.
Pythonのデータ型まとめメモ
Last updated at Posted at 2020-04-27
まとめ
- Iterable:
for
文で回せる
- Iterator:
len()
できない
-
enumerate()
, zip()
, map()
, filter()
の戻り値
-
itertools
で用意されている関数の戻り値
- file object:
open()
の戻り値など
- Generator: ジェネレータ式・関数の戻り値
- Collection:
len()
できる
array.array
enum.Enum
- Sequence: indexとsliceが使える
list
str
collections.deque
-
range()
の戻り値
tuple
- Set: 集合の演算が使える
- Mapping: keyとvalueが定義されている
-
dict
collections.defaultdict
collections.Counter
collections.ChainMap
- Number
-
decimal.Decimal
: 任意精度の浮動小数点数
- Complex
complex
- Real
fraction.Fraction
float
-
int
参考
abc --- 抽象基底クラスなど
Register as a new user and use Qiita more conveniently
- You get articles that match your needs
- You can efficiently read back useful information
- You can use dark theme
What you can do with signing up