input: Write a function to generate a random password of 8 characters containing letters, digits, and special characters. If no input is provided, the function 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)
  
  generate_password()
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)