input: Write a function to generate a random password of length 8, containing at least one uppercase letter, one lowercase letter, one digit, and one special character.
  
  assert generate_password()== any of ["Rn6$Txl!", "7G#zm9*o", "L@3bH8vQ"], where any() means any one of the given strings
  assert len(generate_password())==8
output: import random
  import string
  
  def generate_password():
      while True:
          password = ''.join(random.choices(string.ascii_letters + string.digits + string.punctuation, k=8))
          if (any(c.isupper() for c in password) and
              any(c.islower() for c in password) and
              any(c.isdigit() for c in password) and
              any(c in string.punctuation for c in password)):
              return password