input: Write a python function to generate a secure password.
  assert len(generate_password()) == 8
  assert any(c.islower() for c in generate_password())
  assert any(c.isupper() for c in generate_password())
  assert any(c.isdigit() for c in generate_password())
  assert any(c in "!@#$%^&*" for c in generate_password())
output: import random
  import string
  
  def generate_password():
      length = 8
      lower = string.ascii_lowercase
      upper = string.ascii_uppercase
      digits = string.digits
      symbols = "!@#$%^&*"
      
      # Ensure the password has at least one of each type of character
      password = [
          random.choice(lower),
          random.choice(upper),
          random.choice(digits),
          random.choice(symbols)
      ]
      
      # Fill the rest of the password length with a random selection of all character types
      all_characters = lower + upper + digits + symbols
      password += random.choices(all_characters, k=length - len(password))
      
      # Shuffle the list to ensure randomness
      random.shuffle(password)
      
      return ''.join(password)