Datatype
Description
Is Immutable?
Example Int We can use to represent the whole/integral numbers Immutable >>> a=10 >>> type(a)
Float
We can use to represent the decimal/floating point numbers
Immutable
>>> b=10.5
>>> type(b)
Bool
We can use to represent the logical values (Only allowed values are True and False)
Immutable
>>> flag=True
>>> flag=False
>>> type(flag)
bytes
To represent a sequence of byte values from 0-255
Immutable
>>> list=[1,2,3,4]
>>> b=bytes(list)
>>> type(b)
range
To represent a range of values
Immutable
>>> r=range(10)
>>> r1=range(0,10)
>>> r2=range(0,10,2)
31 https://www.youtube.com/durgasoftware
list To represent an ordered collection of objects Mutable >>> l=[10,11,12,13,14,15] >>> type(l)
tuple
To represent an ordered collections of objects
Immutable
>>> t=(1,2,3,4,5)
>>> type(t)
frozenset
To represent an unordered collection of unique objects
Immutable
>>> s={11,2,3,'Durga',100,'Ramu'}
>>> fs=frozenset(s)
>>> type(fs)
14) None Data Type: None means nothing or No value associated. If the value is not available, then to handle such type of cases None introduced. It is something like null value in Java.
Eg: def m1(): a=10
print(m1()) None