
How to determine a Python variable's type?
# How to determine a Python variable's type?
# Set username to string value.
username = 'factober'
# Print username value on terminal.
print(type(username))
# Output: <class 'str'>
# Set pincode to integer value.
pincode = 1234
# Print pincode value on terminal.
print(type(pincode))
# Output: <class 'int'>
# Set percentage to float value.
percentage = 0.5
# Print percentage value on terminal.
print(type(percentage))
# Output: <class 'float'>
Programming Language: Python
Description: Python is an interpreted high-level general-purpose programming language. It focuses on code readability with its indentation. It can be used for Automation, IoT, Game Development, Desktop Applications, Web Development, Artificial Intelligence, Machine Learning & Data Science.