input: Write a function to generate random passwords that consist of 8 characters by combining uppercase and lowercase letters and digits. The function should return the generated password.
  assert generate_password() != 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))