All Courses
Python Datatypes

Python Data Types

May 17th, 2019 python

Python Data Types

Data types are used to define the type of the variable. We do not need to declare datatype in python as we do in other languages. We can assign values to a variable simply.

Basic Datatypes in Python

  • Numeric
  • String
  • List
  • Tuple
  • Dictionary

Numeric Data Types

Variables with numeric datatypes hold numeric values.
Int – For non-limited length signed integers.
Long – For long integers
Float – For decimal numbers (accurate up to 15 decimals)
Complex – For complex numbers.
Variables with string datatypes hold a sequence of characters. In general, strings are represented by single or double quotes.
Numeric Data Types

String Data Type:

Variables with string datatypes hold a sequence of characters. In general, strings are represented by single or double quotes.
String Data Types

List Data Types:

The list is an exclusive data type of Python. A list in python can hold a different type of data simultaneously.
List Data Type

Tuple Data Types:

A tuple is similar to a List where it can hold different data simultaneously. But the difference is the values in tuples cannot be modified. It is immutable. Tuples use parenthesis where List uses square braces.
Tuple Data Type

Dictionary Data Types:

Dictionary in python is unordered, changeable and indexed collection.
Dictionary format: {Key:Value, Key:Value, …}
Dictionary Data Type

Social Share:

0 responses on "Python Data Types"

Leave a Message

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