Data types in Python explained

 Data Types in Python



Data Types in Python 

The real life data is of many types. To represent this real life data in programming, interpreter/compiler uses some data types. The data types are classified on the basis of the structure of data.

Core Data Types in Python are:-



Brief description of all the above data types are as follows:-
  • Integer - Data in the format of integer comes under this. 
  • Floating Point - Numerical decimal data is known as float.
  • Complex - Data in the form of Complex numbers.
  • Boolean - True and False
  • String - Text data is known as string in python.
  • Tuple -  A tuple is collection of python objects separated by comma. Tuples are represented by parentheses ().
  • List - A list is a data type that can be used to store data in any format. The values in the list are called elements or items of the list. Lists are represented by square brackets [].

    Difference between List and Tuple is that List is mutable i.e. value of the elements of the list can be changed while Tuple is immutable and it's content cannot be changed.
  • Array - It is a homogenous data structure which is used to store sequence of consecutive numbered objects. Each object in a array can be accessed from it's index.
  • Dictionary - In this data is stored in the format of key value pair separated by colon  (:). The content of dictionary can be accessed from the unique key.
    Note :- Items of dictionary can be changed and thus it is mutable but the value of key cannot be changed and thus key is immutable.
This is the basic overview of the data types in python. If you want to learn these in more depth, then you can check the "Ultimate Python Course". This course is available completely free of cost. You can learn Python from beginner to advance level in a new interesting way with Projects and Assignments, Practice Sets.

For any doubts feel free to ask in comments below.
Stay Connected to Us for more such Courses and Projects.

Post a Comment

For any doubts feel free to ask in comments below.
Stay Connected to Us for more such Courses and Projects.

Post a Comment (0)

Previous Post Next Post