Built In Data Types in Python

  • None
  • Integer – effectively a BigInt
  • Float – effectively a 64 bit floating point number on a 64 bit system
  • complex – a pair of floats
  • string – A continuous ordered collection of characters
  • list – an ordered heterogeneous collection of objects
  • set – an unordered heterogeneous collection of unique objects
  • dictionary – A key, value pair mapping
  • frozenset – a read only set
  • frozendict – a read only dict
  • tuple – an immutable ordered heterogeneous collection of objects.
  • file – an open file
  • slice – a type for holding information on slicing collections.

If you include the standard library – the list above is expanded :

  • rational – A numeric type for fractions
  • decimal – a fixed precision decimal number
  • bytearray – an array indexed per byte
  • time – a type to store and manipulate a time of day
  • timedelta – a type to hold a relative time difference
  • datetime – a type to store and manipulate a date time.
  • queues -A synchronised queue
  • defaultdict – Dictionary with an automatically generated default for missing keys
  • NamedTuple – A read-only tuple like object with named fields
  • Counter – A defaultdict implementation designed to count things, and then combine counts etc.
  • deque – A simple queue

Author: Aditya Bhuyan

I am an IT Professional with close to two decades of experience. I mostly work in open source application development and cloud technologies. I have expertise in Java, Spring and Cloud Foundry.

Leave a Reply

Please log in using one of these methods to post your comment:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s