Bytes Methods

bytes.isupper()

Check that at least one ASCII uppercase letter occurs and no ASCII lowercase letters occur. Digits, punctuation and non-ASCII byte values are ignored by this case test. Data with no ASCII letters, including an empty sequence, returns False. The receiver is not modified. Returns a Boolean, not a transformed sequence. These operations are intended for ASCII-compatible data, not arbitrary binary formats.

Formal Syntax & Structure

python syntaxpython
data.isupper()

Return Value

bool

True when the stated condition holds; False otherwise.

Working Example

Example Snippetpython
for token in (bytes(b'API-7'), bytes(b'Api'), bytes(b'\xffA')):    print(token, token.isupper())
Python Reference