input: Write a function to generate a random password of length 8 containing letters, digits, and special characters.
  assert len(generate_password()) == 8
  assert any(c.islower() for c in generate_password())
  assert any(c.isupper() for c in generate_password())
  assert any(c.isdigit() for c in generate_password())
  assert any(c in '@#$' for c in generate_password())
output: import random
  import string
  
  def generate_password():
      length = 8
      all_characters = string.ascii_letters + string.digits + '@#$'
      password = [
          random.choice(string.ascii_lowercase),
          random.choice(string.ascii_uppercase),
          random.choice(string.digits),
          random.choice('@#$')
      ] + [random.choice(all_characters) for _ in range(length - 4)]
      random.shuffle(password)
      return ''.join(password)