input: Write a python function to repeat every second character in a string twice.
  assert repeat_char('HelloWorld') == 'HeellooWorrlld'
  assert repeat_char('abcd') == 'abccdd'
  assert repeat_char('python') == 'pyytthhoon'
output: def repeat_char(s):
      result = []
      for i, char in enumerate(s):
          if i % 2 == 1:
              result.append(char * 2)
          else:
              result.append(char)
      return ''.join(result)