How to check if all letters in a string are uppercase in Python

1 Answer

0 votes
import string

s = 'PYTHON'

if any([letter in s for letter in string.ascii_uppercase]):
    print('yes')
else:
    print('no')


'''
run:

yes

'''

 



answered Nov 19, 2017 by avibootz
...