I need help with the str.isupper() function. I am trying to use it in an if/elif/else statement. The program is this.
String = raw_input( \'Please enter a string
The print statement required two minor corrections:
String = raw_input( 'Please enter a string. ')
if String[:1].isupper():
print 'The first character,' + String[0] + ', is capitalized'
The first was that String
needed to be capitalized. and the second was to remove the parentheses.
MORE: Here is the code with a working if/else statement to show both cases:
String = raw_input( 'Please enter a string. ')
if String[:1].isupper():
print 'The first character, ' + String[0] + ', is capitalized'
else:
print 'The first character, ' + String[0] + ', is not capitalized'