Aug-29-2021, 11:14 PM
i have a string that may be a valid AMI ID in AWS context. that would be "ami-" followed by 17 hexadecimal digits. checking the prefix and length is direct enough. i was hoping there was a str method like there is isdecimal() for decimal digits, but there isn't. so i am using my own function like:
def ishex(s): try: n = int(s,16) return True except ValueError: return Falsei was wondering if there was something better in Python so i can ditch this little function.
Tradition is peer pressure from dead people
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.
What do you call someone who speaks three languages? Trilingual. Two languages? Bilingual. One language? American.