Skip to content

Instantly share code, notes, and snippets.

@codewithpom
Created July 13, 2021 05:47
Show Gist options
  • Save codewithpom/e2f43ae7d7ff32527329b55794a24122 to your computer and use it in GitHub Desktop.
Save codewithpom/e2f43ae7d7ff32527329b55794a24122 to your computer and use it in GitHub Desktop.
Get datatype of variable in Python.
# make integer variable
number = 89
print(type(number))
# <class 'int'>
# make float variable
decimal_number = 9.7
print(type(decimal_number))
# <class 'float'>
# make string variable
string = "Hello World"
print(type(string))
# <class 'str'>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment