Python datatypes
Python

Python datatypes

Editorial Team
Editorial Team

Follow us on Discord or Telegram to get access to free tutorials and updates.

Datatypes are used to hold different types of values. Python supports the following five standard datatypes.

Python automatically determines the data type based on the value assigned to it. You can find the datatype of a variable using type() function.

Example

a=10;
print(type(a)) #int datatype
a='John'
print(type(a)) #string datatype

Output

<class 'int'>
<class 'str'>