Menu

Sign in to track your progress and unlock all features.

Theme style

Log in

Problem No 8

Is Single Character Uppercase

Easy

8 minute session

Summary

Check whether a given input is a single uppercase letter A-Z.

Problem statement

Write a function that takes one argument s and returns True if s is a string consisting of exactly one character and that character is an uppercase English letter (A-Z). For any other input (empty string, multiple characters, lowercase letters, digits, symbols), return False. Assume input will be a string.

Task

Implement a function that returns True only when the input is a single uppercase alphabetic character.

Examples

Example

Input

'A'

Output

True

Explanation

'A' is a single uppercase letter.

Input format

A single string s.

Output format

A boolean: True if s is a single uppercase alphabetic character, otherwise False.

Constraints

Input is a string. Consider only English alphabet uppercase letters A-Z.

Samples

Sample input 0

'a'

Sample output 0

False

Explanation 0

Lowercase letters should return False.

Code editor
Loading editor…

AI assistant

Ask me anything!

Need help? I can explain the core idea behind this problem, review your current code, and give targeted hints. Use “Teach Theory” for the concept, “Get AI hint” for a quick scaffold nudge, or ask a specific question below.

Chat history is temporary and will not be saved.

04:59 AM

Free preview includes 1 Teach Theory response and 1 AI hint per unlocked preview lesson.