input: Write a function to generate a random password consisting of 8 characters. The password should include both uppercase and lowercase letters, as well as digits. Return the generated password as a string.
  assert generate_password()=='A1b2C3d4'
  assert generate_password()=='e5F6g7H8'
  assert generate_password()=='i9J0k1L2'
output: import random
  import string
  
  def generate_password():
      characters = string.ascii_letters + string.digits
      return ''.join(random.choice(characters) for _ in range(8))