If the object is not assigned any value, we call it NoneType.
a=None
print(type(a)) # <class 'NoneType'>
Range
sequence of numbers ( Immutable ) can be returned by using range(). These are range data type.
x=range(5) # 5 is stop value
print(type(x)) # <class 'range'>
bool
Bool data type stors values True or False. Read more on bool()
a=True
print(type(a)) # <class 'bool'>
str
String data types. Built in function str() update to string data type.
print(type("Welcome")) #<class 'str'>
Apart from these built in data types, user can create its own data types by using class.
class Animal():
#instance attributes
def __init__(self1,name1,age):
self1.name= name1
self1.age=age
#instantiate the Animal class
tiger=Animal("Ronald",5) # tiger is an object of Animal class
print(type(tiger)) # <class '__main__.Animal'>