Python Datatypes

String Datatype

xyz = “Welcome to Python!!!”
print(type(xyz))

Integer Datatype

xyz = 20
print(type(xyz))

Float Datatype

xyz = 20.5
print(type(xyz))

Complex Datatype

xyz = 1j
print(type(xyz))

List Datatype

xyz = [“Red”, “Green”, “Blue”]print(type(xyz))

Tuple Datatype

xyz = (“Red”, “Green”, “Blue”)
print(type(xyz))

Range Datatype

xyz = range(6)
print(type(xyz))

Dict Datatype

xyz = {“name” : “Smith”, “age” : 30}
print(type(xyz))

Set

xyz = {“Red”, “Green”, “Blue”}
print(type(xyz))

Frozenset

xyz = frozenset({“apple”, “banana”, “cherry”})
print(type(xyz))

Boolean Datatype

xyz = True
print(type(xyz))

Bytes Datatype

xyz = b”Hello”
print(type(xyz))

Byte Array Datatype

xyz = bytearray(5)
print(type(xyz))

Memory View Datatype

xyz = memoryview(bytes(5))
print(type(xyz))

xyz = str(10)
print(type(xyz))

xyz = xyz + str(1)
print(xyz)

Leave a Comment

You have successfully subscribed to the newsletter

There was an error while trying to send your request. Please try again.

IT Panther will use the information you provide on this form to be in touch with you and to provide updates and marketing.
%d bloggers like this: