MATLAB and Python: Validating Hexadecimal Strings
# Check for out of range values if any([any([(not('0' le == c le == '9')) and (not('A' le == c le == 'F')) and (not('a' le == c le == 'f')) for c in row]) for row in h]): raise ValueError('Input string found with characters other than 0-9, a-f, or A-F.')
原文地址: https://www.cveoy.top/t/topic/qFHw 著作权归作者所有。请勿转载和采集!