input: Write a function to generate a random password given a set of letters, numbers, and characters. The password should be 8 characters long. If no input is provided, the function should generate a password using the default set of characters. Return the generated password as a string.
  assert generate_password()==generate_password() # Ensure passwords are random
  assert len(generate_password())==8 # Ensure password length is 8
output: import random
  import string
  
  def generate_password(chars=string.ascii_letters + string.digits + string.punctuation):
      return ''.join(random.choice(chars) for _ in range(8))