input: Write a python function to generate a password consisting of alternating uppercase letters and numbers.
  assert len(generate_password()) == 8
  assert any(char.isdigit() for char in generate_password())
  assert any(char.isupper() for char in generate_password())
output: import random
  import string
  
  def generate_password():
      password = []
      for i in range(4):
          password.append(random.choice(string.ascii_uppercase))
          password.append(random.choice(string.digits))
      return ''.join(password)