input: Write a function to generate a random password. The function should create a string of 8 characters which can include numbers, letters, and special characters. The function should return the generated password. If the function is invoked, it should print the generated password.
  def generate_password():
   password_characters = string.ascii_letters + string.digits + string.punctuation
   password = ''.join(random.choice(password_characters) for i in range(8))
   print(password)
   
  assert len(generate_password())==8
  assert any(char.isdigit() for char in generate_password()) == True
  assert any(char.isalpha() for char in generate_password()) == True
  assert any(char in string.punctuation for char in generate_password()) == True
output: def generate_password():
      import random
      import string
      password_characters = string.ascii_letters + string.digits + string.punctuation
      password = ''.join(random.choice(password_characters) for i in range(8))
      print(password)