Ctrl K

Proper Capitals

Easy
You are given a word word made of English letters. Its capitals are used properly if one of the following holds: - every letter is a capital, as in NASA; - no letter is a capital, as in river; - only the first letter is a capital, as in Paris. Return True if the word uses capitals properly and False otherwise.
Example 1
word='NASA' → True

Every letter is a capital, which is allowed.

Example 2
word='Paris' → True

Only the first letter is a capital, which is also fine.

Example 3
word='iPhone' → False

The capital is not at the start, so none of the three rules applies.

Constraints
  • 1 ≤ len(word) ≤ 100
  • word consists of uppercase and lowercase English letters
Have you seen this problem in a real interview?
Solved by0
Tried by0
Submissions0
Acceptance—
Topics
Similar problemsValue of a Roman Numeral EasyShared Start of Words EasyBracket Balance EasyWhere the Fragment Starts EasyLength of the Final Word Easy
loading Python…
Input
word='NASA'
Expected
True

Run checks the first 3 tests in your browser. Submit checks all 403 tests on the server, hidden ones included.