How to test if a string has capital letters

Viewed 5552

In Scala I could test if a string has a capital letter like this:

val nameHasUpperCase = name.exists(_.isUpper)

The most comprehensive form in Python I can think of is:

a ='asdFggg'
functools.reduce(lambda x, y: x or y, [c.isupper() for c in a])
->True

Somewhat clumsy. Is there a better way to do this?

3 Answers
Related