Python Datatypes

Welcome to Python tutorials for beginners. In this tutorial you are going to learn a lot about Python datatypes. Here is the list of all the supported Python datatype which are typically used in order to create an application or a website.

Python for beginners complete course

Python String Datatype

Python string datatype is most commonly used datatype. There is hardly any Application developed in Python Program without using String datatype. Whenever you take input from user using Python Input() Method, the receive data is by default of String datatype.

xyz = "Welcome to Python!!!"
print(type(xyz))

Python Integer Datatype

xyz = 20
print(type(xyz))

Python Float Datatype

xyz = 20.5
print(type(xyz))

Python Complex Datatype

xyz = 1j
print(type(xyz))

Python List Datatype

Without a doubt my most favorite datatype in python is Python lists. Lists are not only so easy to maintain data but also easy to iterate through. In addition to that lists come quite handy when you are dealing with REST APIs. Rest APIs provide you data in the form of JSON which is quite similar to python lists and dictionary datatype. Here is how a typical list datatype will look like.

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

Python Tuple Datatype

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

Python Range Datatype

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

Python Dict Datatype

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

Python Set Datatype

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

Python Frozenset

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

Python Boolean Datatype

xyz = True
print(type(xyz))

Python Bytes Datatype

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

Python Byte Array Datatype

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

Python Memory View Datatype

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

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

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

Excited to learn more from Python Tutorials for Beginners?

If you are liking Python Programming for beginners tutorials then continue reading more here. Alternatively, do consider subscribing to my Youtube channel to continue learning more on Python programming and automation you can do using python programming.

Excited to learn Python tutorials for beginners?
Scroll to Top