input: Write a python function to generate a random password of given length including uppercase, lowercase letters and numbers.
  assert len(generate_password(8)) == 8
  assert len(generate_password(12)) == 12
  assert any(c.isupper() for c in generate_password(10))
  assert any(c.islower() for c in generate_password(10))
  assert any(c.isdigit() for c in generate_password(10))
output: import random
  import string
  
  def generate_password(length):
      if length < 1:
          return ""
      
      all_characters = string.ascii_letters + string.digits
      password = [
          random.choice(string.ascii_uppercase),
          random.choice(string.ascii_lowercase),
          random.choice(string.digits)
      ]
      
      if length > 3:
          password += random.choices(all_characters, k=length - 3)
  
      random.shuffle(password)
      return ''.join(password)