UPPER_SNAKE_CASE. Write a function is_constant_name(name) that returns True if the given identifier string name follows this convention (all letters uppercase, words separated by single underscores, no leading/trailing underscore, at least one letter), and False otherwise.is_constant_name("MAX_RETRIES")True
All-uppercase words joined by underscores.
is_constant_name("maxRetries")False
camelCase is not the constant convention.
is_constant_name("_HIDDEN")False
Leading underscore disqualifies it here.
Check `name == name.upper()` and `name` has no leading/trailing underscore.
Split on "_" and make sure no piece is empty (rules out doubled or edge underscores).