-6

How can I find the datatype of a variable in Python as auto datatypes are mentioned in python?

Ismael Padilla
  • 5,246
  • 4
  • 23
  • 35
Ranjeet R Patil
  • 453
  • 6
  • 10

2 Answers2

3

To find the type of a variable, in python you can use the type(variable) method.

Sanjay SS
  • 568
  • 4
  • 14
2

yep, this:

foo = 1
print(type(foo))

results in:

<class 'int'>
[Finished in 0.1s]
Warlax56
  • 1,170
  • 5
  • 30