-6

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

2
  • 2
    type(variable_name) Commented Nov 23, 2020 at 6:48
  • 1
    Please verify first before posting your question , if the same has been answered or not. Commented Nov 23, 2020 at 7:01

2 Answers 2

3

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

Sign up to request clarification or add additional context in comments.

Comments

2

yep, this:

foo = 1
print(type(foo))

results in:

<class 'int'>
[Finished in 0.1s]

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.