def obscure_string(input_string):
 if ((input_string is None) or (len(input_string) < 4)):
  return input_string
 last_four = input_string[(-4):]
 obscured = ('*' * (len(input_string) - 4))
 return (obscured + last_four)

def obscure_string ( input_string ) : if ( ( input_string is None ) or ( len ( input_string ) < 4 ) ) : return input_string last_four = input_string [ ( - 4 ) : ] obscured = ( '*' * ( len ( input_string ) - 4 ) ) return ( obscured + last_four )
obscures the input string by replacing all but the last 4 characters in the string with the character * .