input: Write a function to generate a password containing at least one special character.
  assert len(generate_password()) == 8
  assert any(char in string.punctuation for char in generate_password())
  assert not all(char.isalnum() for char in generate_password())
output: import string
  import random
  
  def generate_password():
      characters = string.ascii_letters + string.digits + string.punctuation
      password = [
          random.choice(string.punctuation),  # Ensure at least one special character
          random.choice(string.ascii_letters),
          random.choice(string.digits)
      ]
      password += random.choices(characters, k=5)
      random.shuffle(password)
      return ''.join(password)