3 ms·
You could do that in Python using the ord function. white_ranges = [('0', '9'), ('A', 'Z'), ('a', 'z')] any([ord(low) <= ord(x) <= ord(high) for low, h
by JesseAldridge 15y ago
You could do that in Python using the ord function.
white_ranges = [('0', '9'), ('A', 'Z'), ('a', 'z')]
any([ord(low) <= ord(x) <= ord(high) for low, high in white_ranges])
- deleted 15y ago[deleted]
- deleted 15y ago[deleted]
- pavpanchekha 15y agoThe point is that because conversions from characters to ints aren't free, similar things can't be done cheaply.