Python Data Types

Python Data Types

Python supports several built-in data types. Some of the commonly used data types in Python include:

  1. Numeric Types:
    • int: Integer values (e.g., 5, -3, 0).
    • float: Floating-point values with decimal places (e.g., 3.14, -0.5).
    • complex: Complex numbers in the form a + bj, where a and b are floats and j represents the imaginary unit (e.g., 2 + 3j).
  2. Sequence Types:
    • str: Strings of characters (e.g., “Hello”, ‘World’).
    • list: Ordered, mutable sequences of elements (e.g., [1, 2, 3], [‘apple’, ‘banana’, ‘cherry’]).
    • tuple: Ordered, immutable sequences of elements (e.g., (1, 2, 3), (‘red’, ‘green’, ‘blue’)).
  3. Mapping Type:
    • dict: Key-value pairs, also known as dictionaries (e.g., {‘name’: ‘John’, ‘age’: 25}).
  4. Set Types:
    • set: Unordered collections of unique elements (e.g., {1, 2, 3}).
    • frozenset: Immutable version of a set (e.g., frozenset({1, 2, 3})).
  5. Boolean Type:
    • bool: Represents truth values (True or False).
  6. None Type:
    • None: Represents the absence of a value or a null value.

These are the fundamental data types in Python. Additionally, Python allows you to create custom data types using classes and objects, which are part of object-oriented programming.

Leave a Reply

Your email address will not be published. Required fields are marked *

GLOTRU Footer
Popular Features
Popular Services/

Website Development & Design

App Development & Design

Graphic Design

Digital Marketing

SEO (Search Engine Optimization)

SMM (Social Media Marketing)

Cyber Security

Company

GLOTRU Founder & CEO : __Azam

Registared : Trade,MSME,etc

Board of Director

Team

About Us

Contact Us

Privacy Policy

Return & Refund Policy

Abuse Policy

Copyright Policy

Cookie Policy

Terms & Conditions

Universal Terms of Service

Disclaimer

Legal

Sponsorships

Investor

Press Releases

Our Investments

Brands

Newsroom

Business

...

_

Digital Millennium Copyright Act
DMCA.com Protection Status

_

Content similarity detection
Protected by Copyscape

_

***ANTI-PIRACY WARNING***

...................................................................................

Follow Us :

...................................................................................

SECURE SERVER : [Legal] [Privacy Policy] [Universal Terms of Service] [Do not sell my personal information]

SITE HOSTED : GLOTRU SECURE SERVER Asian Data Centre [You can host your site][Click Here]

SSL : Server Type : [Cloudflare] Certificate Issued By : [Let's Encrypt] Signature Algorithm : [ECDSA with SHA-384]

SITE BUILD SOFTWARE : Content Management System (CMS) Softwere

_

_

_