Tuple to list : Convert to List « 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)
print tupleList








6.4.Convert to List
6.4.1.Tuple to list