Python 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.

Python datatypes

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'>


Share Tweet Send
0 Comments
Loading...