Data types are used to store data or information in a variable. Python data types are dynamic because we don’t need to mention type of the variable. But in other languages, we should mention the type of data. See the below example you can get the clarity.

Numbers: Number data types are used to store integers or numbers or float values of imaginary values.

Example:

           x = 10 (Integer)

 

           x = 10.5 (float)

 

           x = 10+i5 (imaginary)

 

Strings: String is nothing but a group of characters. String data types are used to store strings in a variable.

 

Examples:

          X = ‘regularpython.com

           X = “regularpython.com

           X = “““regularpython.com”””

Lists: Lists are used to store a sequential data types

Example: X = [1, 2, 3, 4, 5, 6]

           X = [‘mangoes’, ‘orange’, ‘gapes’]

           X = [1,2,3, ‘mangoes’, ‘oranges’]

Tuples: Tuples also used to store sequential data types. But the difference between tuple and list is, List is mutable (we can edit, update, delete) and tuple is immutable (we can’t edit, update, delete).

Example:           X = (1, 2, 3, 4, 5, 6)

           X = (‘mangoes’, ‘orange’, ‘gapes’)

           X = (1,2,3, ‘mangoes’, ‘oranges’)

Dictionaries: Dictionaries are used to store data in the form of a key-value pair. Dictionary is nothing but a JSON data type. In python, we called a dictionary, in other languages we called it JSON.

Example: X = { ‘name’:’ python’,  ‘Rank’: 1}

Sets:   Sets are mainly used to get or store unique values only. If you want to remove duplicates then you can use sets.

Example: X = {1,2,3,4}

Boolean: Boolean data types are mainly in conditions. Boolean data types,

 True

 False

Example: 

           if 2==2:

                 print(‘same’)

           else:

                print(‘Not Same’)

                 

### Some Methods of Data Types ###

list.append  

append(self, object, /)

   Append object to the end of the list.

 

list.clear

clear(self, /)

   Remove all items from list.

   

int.bit_length

bit_length(self, /)

   Number of bits necessary to represent self in binary.

   

   >>> bin(37)

   '0b100101'

   >>> (37).bit_length()

   6

 

list.insert

insert(self, index, object, /)

   Insert object before index.

   

tuple.count

count(self, value, /)

   Return number of occurrences of value.

   

tuple.mro

mro() method of builtins.type instance

   Return a type's method resolution order.

 

bool.denominator

denominator

   the denominator of a rational number in lowest terms

   

bool.conjugate

conjugate(...)

   Returns self, the complex conjugate of any int.

   

dict.copy

copy(...)

   D.copy() -> a shallow copy of D

   

dict.items

items(...)

   D.items() -> a set-like object providing a view on D's items

   

set.add

add(...)

   Add an element to a set.

   

set.difference

difference(...)

   Return the difference of two or more sets as a new set.

   

str.capitalize

capitalize(self, /)

   Return a capitalized version of the string.

   

str.count

count(...)

   S.count(sub[, start[, end]]) -> int

   

   Return the number of non-overlapping occurrences of substring sub in

   string S[start:end].

source: http://www.regularpython.com/webscraper/python-basics/1/5/regularpython-regular-python-python-data-types