input: Write a python function to generate a random password of length 8 containing upper and lower case letters, digits, and symbols.
  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():
      upper = random.choice(string.ascii_uppercase)
      lower = random.choice(string.ascii_lowercase)
      digit = random.choice(string.digits)
      symbol = random.choice(string.punctuation)
      all_characters = string.ascii_letters + string.digits + string.punctuation
      remaining_chars = [random.choice(all_characters) for _ in range(4)]
      password_list = list(upper + lower + digit + symbol + ''.join(remaining_chars))
      random.shuffle(password_list)
      return ''.join(password_list)