Run
str = 'pythonexamples125' if str.isalnum(): print('Given string contains only alphanumeric.') else: print('Given string does not contain only alphanumeric.')
Output