LoginSignup
4
3

More 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: 集合の演算が使える
        • set
        • frozenset
      • Mapping: keyとvalueが定義されている
        • dict
          • collections.defaultdict
          • collections.Counter
        • collections.ChainMap
  • Number
    • decimal.Decimal: 任意精度の浮動小数点数
    • Complex
      • complex
      • Real
        • fraction.Fraction
        • float
        • int
          • bool

参考

abc --- 抽象基底クラスなど

4
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
3