input: Write a function to generate a random password consisting of 8 characters. The characters should be a mix of uppercase and lowercase letters and digits. If the function is called without any input, it should return a string of 8 random characters.
  
  assert generate_password()!=generate_password()
  assert len(generate_password())==8
  assert any(c in generate_password() for c in string.ascii_letters)
  assert any(c in generate_password() for c in string.digits)
  assert all(c in string.ascii_letters + string.digits for c in generate_password())
output: import random
  import string
  
  def generate_password():
      return ''.join(random.choices(string.ascii_letters + string.digits, k=8))