input: Write a python function to generate a random password of a given length containing uppercase and lowercase letters, digits, and special characters.
  assert len(generate_password(12)) == 12
  assert len(generate_password(8)) == 8
  assert generate_password(0) == ''
  assert all(c in 'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789@#!' for c in generate_password(16))
output: import random
  import string
  
  def generate_password(length):
      if length == 0:
          return ''
      
      characters = string.ascii_letters + string.digits + '@#!'
      password = ''.join(random.choice(characters) for _ in range(length))
      return password