Answers for "python check variable is tuple"

0

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
Posted by: Guest on July-29-2021

Code answers related to "python check variable is tuple"

Python Answers by Framework

Browse Popular Code Answers by Language