input: Write a python function to generate a random password with a specified length containing letters, digits, and special characters '$#&'.
  assert len(generate_password(8)) == 8
  assert len(generate_password(12)) == 12
  assert all(c in (string.ascii_letters + string.digits + '$#&') for c in generate_password(10))
output: import random
  import string
  
  def generate_password(length):
      if length < 1:
          return ""
      
      characters = string.ascii_letters + string.digits + '$#&'
      password = ''.join(random.choice(characters) for _ in range(length))
      
      return password