

- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to check if a character is upper-case in Python?
To check if a character is upper-case, we can simply use isupper() function call on the said character.
example
print( 'Z'.isupper()) print( 'u'.isupper())
Output
True False
We can also check it using range based if conditions.
example
def check_upper(c): if c >= 'A' and c <= 'Z': return True else: return False print check_upper('A') print check_upper('a')
Output
This will give us the output:
True False
- Related Questions & Answers
- How to check if a string contains only upper case letters in Python?
- Java Program to check whether the entered character a digit, white space, lower case or upper case character
- How to check if a character in a string is a letter in Python?
- C# Program to check if a character is a whitespace character
- Program to check if matrix is upper triangular in C++
- Check if a character is alphanumeric in Arduino
- Check if a character is printable in Arduino
- How to convert Lower case to Upper Case using C#?
- How to convert Upper case to Lower Case using C#?
- Convert a C++ String to Upper Case
- Converting to upper case in Java.
- How to check if a string contains only lower case letters in Python?
- MySQL Query to change lower case to upper case?
- Check if a character is Space/Whitespace in Arduino
- How to check if a given character is a number/letter in Java?
Advertisements