CodeBlessU
learn code with examples

Get Data Type of Variable

Use type() method to find data type of variable.

Argument is mandatory.

Syntax:
type(variable)
Return Value:
data type
# Example, find data type of variable.
my_int = 5

type(my_int) # returns class 'int'

# print data type of variable.
print( type(my_int)) # prints class 'int'

In this page...

Copyright © All rights reserved.