Data Types in Python

basic of python,

Sourabh Somani Sourabh Somani Follow Apr 14, 2018 · 1 min read
Share this

Introduction

In this tutorial, we will learn about python data types

A data type is a classification of one of a variety of types of data, such as Number, Boolean, Strings and so on. Data types determine the possible value for the type. If an operation is done then it can be done on the value of that type.

In the Python programming language, every value has a datatype. You don’t need to declare it but you don’t need to declare the datatype for that specific variable. Like in JavaScript based on the data that we assign to the variable, Python determines the type. In the Python, everything is an object.

Python has many native datatypes that are listed as in the following:

  • Boolean: True or False
  • Integer: Positive and Negative values like -1,-2, 0, 2, 8 and so on.
  • Float: 0.2, 2.8 and so on.
  • Fraction: 3/5, 2/7 and so on.
  • Complex: Values that have a real part and complex part like 2 + 3i.
  • String: String is the sequence of Unicode characters
  • Byte, and Byte Array: This data type can save any binary files like Image(jpg, png, bmp and so on. )
  • List: An Ordered sequence of value.
  • Tuples: Ordered immutable sequence of value.
  • Sets: An Unordered bag of values or Objects.
  • Dictionaries: Unordered bags of key-value pair.
Join Newsletter
Get the latest news right in your inbox. We never spam!
Sourabh Somani
Written by Sourabh Somani Follow
Sourabh Somani is a Full-Stack Engineer with several years of hands-on experience. He has been awarded 4-times Microsoft MVP award consecutively and C# Corner MVP Award 6-times. Most of the time you will find him helping people on C# Corner and StackOverflow on JavaScript, .NET and Python. He is a frequent contributor to open source software development via forums, articles, and blogs. He regularly speaks at user groups and developer conferences. His core technology interests are JavaScript, Python and .NET.