I want to create a function that performs a certain task only when a hex value indicates an upper or lower case letter, i.e., when the hex code is between 20 and 7A. Is there a way to make a statement in python that is logically equivalent to:
if a >= 20 and a <= 7A: perform stuff
? Do I just throw a 0x in front of it and magic happens?
aan integer or is it a string like"0x2A"?a >= 0x41? --chr(0x41)=='A'a >= 0x41 and a <= 0x7a(or, more readably,ord('A') <= a <=ord('Z'), it's still wrong, because there are 6 non-alphabetic characters in that range. Why not usechr(a).isalpha()`?