Using Tuples : Introduction « Tuple « Python Tutorial






hexStringChars = ('A', 'B','C', 'D', 'E', 'F')
hexStringNums = ('1', '2', '3', '4', '5', '6','7', '8', '9','0')
hexStrings = ["1FC", "1FG", "222", "Ten"]

for hexString in hexStrings:
    for x in hexString:
        if ((not x in hexStringChars) and (not x in hexStringNums)):
            print hexString+ " is not a hex string."
            break

tupleList = list(hexStringChars)
listTuple = tuple(hexStrings)








6.1.Introduction
6.1.1.Tuples: Immutable Sequences
6.1.2.How to write a tuple containing a single value.
6.1.3.Single-Element Tuples
6.1.4.One comma can change the value of an expression completely:
6.1.5.Using Tuples
6.1.6.Assigning Multiple Values at Once
6.1.7.Built-in Functions