Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PYTHON

python check variable is tuple

use isinstance(x, tuple), where x is the variable.
x = 2, 2
print(isinstance(x, tuple))
#Expected: True
y = 2
print(isinstance(y, tuple))
#Expected: False
 
PREVIOUS NEXT
Tagged: #python #check #variable #tuple
ADD COMMENT
Topic
Name
3+7 =