Created
July 13, 2021 05:47
-
-
Save codewithpom/e2f43ae7d7ff32527329b55794a24122 to your computer and use it in GitHub Desktop.
Get datatype of variable in Python.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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