I'd like to check if a Python string contains BOTH letter and number, but nothing else. In other words, strings like "A530", "D592" should return True, whereas strings like "ABCDE" (all letters), "000326" (all number), and "A339*加>" (alphanumeric but also has special characters) will return False.
I've seen a lot of sites that show how to check if string contains either letter or number, but not both. This site https://www.geeksforgeeks.org/python-program-to-check-if-a-string-has-at-least-one-letter-and-one-number/ shows how to check both letter and number, but they iterate through each character in the string, which is not very efficient and something I tried to avoid doing if possible.