riven

Riven

Riven

python data type

Basic Data Types

Integers

Integers are whole numbers without a fractional component. They can be positive, negative, or zero.

Example:

python data type

Characteristics:

  • Unbounded Size: Python integers can be of arbitrary size, limited only by available memory.
  • Arithmetic Operations: Supports operations like addition, subtraction, multiplication, and division.

Example of Arithmetic Operations:

Floats

Floats are numbers that contain a decimal point or are in exponential form. They represent real numbers.

Example:

float data type

Strings

Strings are sequences of characters used to represent text. They are enclosed in either single quotes (') or double quotes (").

Example:

strings data type

Characteristics:

  • Immutable: Strings are immutable, meaning once created, they cannot be changed.
  • Concatenation: Strings can be combined using the + operator.

Example of String Operations:

Booleans

Booleans represent one of two values: True or False. They are often used in conditional statements and logical operations.

Example:

python data type

Characteristics:

  • Logical Operations: Supports operations like and, or, and not.

Example of Boolean Logic: