input: Write a python function to generate a random password of a given length.
  assert len(generate_password(8))==8
  assert len(generate_password(12))==12
  assert len(generate_password(16))==16
output: import random
  import string
  
  def generate_password(length):
      characters = string.ascii_letters + string.digits + string.punctuation
      return ''.join(random.choice(characters) for _ in range(length))