Simple tuple question
Jeff Shipman
shippy at cs.nmt.edu
Mon Mar 20 12:54:44 EST 2000
Well, there are two ways you can go about it:
if type(a) == type(()):
print 'yes'
-or-
import types
if type(a) == types.TupleType:
print 'yes'
Matthew Hirsch wrote:
>
> Hi All,
>
> If I have a tuple a=(1,2,3)
>
> how do I test that this is a tuple?
--
+-----------------------------------------------------+
| Jeff "Shippy" Shipman E-Mail: shippy at cs.nmt.edu |
| Computer Science Major ICQ: 1786493 |
| New Mexico Institute of Mining and Technology |
| Homepage: http://www.nmt.edu/~shippy |
+-----------------------------------------------------+
More information about the Python-list
mailing list