input: Write a function to generate a random 8-character password consisting of letters and digits. The function should not take any input and should return a string representing the generated password.
  assert generate_password()!=""
  assert len(generate_password())==8
  assert any(char.isdigit() for char in generate_password())
output: import random
  import string
  
  def generate_password():
      characters = string.ascii_letters + string.digits
      return ''.join(random.choice(characters) for _ in range(8))