← Back to challenges

Count the Capital Letters

PythonHardstringsloopslanguage_fundamentalsregex

Instructions

Given a string of letters, how many capital letters are there?

Examples

capital_letters("fvLzpxmgXSDrobbgMVrc") ➞ 6

capital_letters("JMZWCneOTFLWYwBWxyFw") ➞ 14

capital_letters("mqeytbbjwqemcdrdsyvq") ➞ 0

Notes

N/A

python3
Loading editor…
to run
Walks through the solution with reasoning and edge cases.
Next: Spotlight Sum