input: Write a function to generate a random password using a predefined set of letters, numbers, and special characters. The function should return the generated password as a string.
  assert generate_password()==None
  assert len(generate_password())==8
  assert any(char.isdigit() for char in generate_password())
  assert any(char.isalpha() for char in generate_password())
  assert any(not char.isalnum() for char in generate_password())
output: import random
  import string
  
  def generate_password():
      characters = string.ascii_letters + string.digits + string.punctuation
      return ''.join(random.choice(characters) for _ in range(8))