Answers for "python check if variable is a specific type"

1

isinstance several variables

'check if variables days, months or years are all integers
if not all(isinstance(i, int) for i in [days, months, years]):
Posted by: Guest on September-05-2020
0

how to check if a variable in python is a specific data type

isinstance(variable_name, class_name) #eg. isinstance(age, int) will return True
Posted by: Guest on December-10-2020

Code answers related to "python check if variable is a specific type"

Python Answers by Framework

Browse Popular Code Answers by Language