input: Write a python function to generate a random password of length 8 containing uppercase, lowercase, digits, and punctuation.
  assert len(generate_password()) == 8
  assert any(c.isupper() for c in generate_password())
  assert any(c.islower() for c in generate_password())
  assert any(c.isdigit() for c in generate_password())
  assert any(c in string.punctuation for c in generate_password())
output: import random
  import string
  
  def generate_password():
      password_chars = (
          random.choice(string.ascii_uppercase) +
          random.choice(string.ascii_lowercase) +
          random.choice(string.digits) +
          random.choice(string.punctuation)
      )
      password_chars += ''.join(random.choices(string.ascii_letters + string.digits + string.punctuation, k=4))
      password_list = list(password_chars)
      random.shuffle(password_list)
      return ''.join(password_list)