What is Data Types in python ? | Type of Data Types

 What is Data type?

  • A data type shows what kind of data is being used.
  • The type() function can be used to determine which type of data.

Example:

Number = 5

Here, 5 is an integer assigned to the variable, so data type of number is int class.


Types of data types:

1. Numeric (int, float, complex): Stores numbers.

Program:



Output:


2. String (str): Stores text.

Program:


Output:


3.Sequence (list, tuple, range): Stores a collection of items.

Program:


Output :



4.Mapping (dict):
Stores data in key-value pairs.

Program:

Output:


5.Boolean (bool): Stores True or False.

Program :


Output :




6.Set (set, frozenset): Stores unique items.

Program:


Output :




Post a Comment

0 Comments