Lesson guide
What this Python exercise practices
Is Single Character Uppercase is a beginner practice lesson that focuses on strings, formatting, traversal. It is designed to be solved in about 8 minutes with examples, starter code, and test feedback.
Prerequisites
- Python variables
- String values
- Basic indexing
Difficulty and time
- Level
- Beginner
- Estimated time
- 8 minutes
Practice path
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.
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.
Free preview includes 1 Teach Theory response and 1 AI hint per unlocked preview lesson.