input: Write a function to generate a random password of 8 characters consisting of letters and digits. If the function is called, a random password should be generated and returned.
  assert generate_password().__len__()==8
  assert any(c in generate_password() for c in string.ascii_letters)
  assert any(c in generate_password() for c in string.digits)
output: import random
  import string
  
  def generate_password():
      characters = string.ascii_letters + string.digits
      return ''.join(random.choice(characters) for _ in range(8))