input: Write a function to generate a random password consisting of 8 characters, using a combination of uppercase and lowercase letters and digits. The function should return the generated password.
  assert generate_password()=="rT7kL3e8"
  assert generate_password()=="aB1cD4eF"
  assert generate_password()=="2jK5mN7p"
  assert generate_password()=="Qw3eR5tY"
  assert generate_password()=="Zx9cV8bN"
output: import random
  import string
  
  def generate_password():
      characters = string.ascii_letters + string.digits
      return ''.join(random.choice(characters) for _ in range(8))