This condition checks if w [ i ] is any uppercase letter apart from letter . If true then replace it with upper ( letter ) .
elif ( w [ i ] >= ' A ' and w [ i ] <= ' Z ' ) : NEW_LINE INDENT w [ i ] = chr ( ord ( ' A ' ) + p ) NEW_LINE DEDENT print ( ' ' . join ( w ) ) NEW_LINE