Saved Bookmarks
| 1. |
Write a program to determine whether the entered character is in uppercase or lowercase, or is an invalid character. |
Answer» Language-used:Python ProgramCHAR = input("Enter a character") if ord(char) >= 65 or ord(char) <= 90: print(char," is upper-CASE") elif ord(char) >= 97 or ord(char) <= 112: print(char," is lower-case") else: print(char," is invalid character") # 65 - 90(CAPS) # 97 - 112 (SMALLS) Output:Enter a character Z 90 Explanation
------HOPE this help :) |
|