input: Write a function to validate a password based on length, presence of both uppercase and lowercase letters, and at least one digit.
  assert validate('user1', 'Password123') == True
  assert validate('user2', 'password') == False
  assert validate('user3', 'PASSWORD123') == False
  assert validate('user4', 'Pass123') == False
output: def validate(username, password):
      if len(password) < 8:
          return False
      has_upper = any(c.isupper() for c in password)
      has_lower = any(c.islower() for c in password)
      has_digit = any(c.isdigit() for c in password)
      return has_upper and has_lower and has_digit