input: 
  def generate_password() -> str:
      """ Generate a random password consisting of 8 characters.
      >>> len(generate_password())
      8
      >>> all(c in string.ascii_letters + string.digits for c in generate_password())
      True
      """
  
output:     import random
      import string
      
      characters = string.ascii_letters + string.digits
      password = ''.join(random.choice(characters) for _ in range(8))
      return password