'Check what is the first letter of a string [closed]
I am writing a function to explain the first charachter of a string. If it is a capital it should return 'upper', if a lower then 'lower', if a digit then 'digit' else 'other'
def solution(s):
c = s[0]
if c.isupper() == True:
return "upper"
The above is not returning true for "Hello". How to go ahead?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
