input: Write a function to generate random passwords that consist of 8 characters. The password should include letters (both uppercase and lowercase) and digits. The function should return the generated password as a string.
  assert generate_password()!='*'
  assert len(generate_password()) == 8
  assert any(c.islower() for c in generate_password()) == True
  assert any(c.isupper() for c in generate_password()) == True
  assert any(c.isdigit() for c in generate_password()) == True
output: import random
  import string
  
  def generate_password():
      characters = string.ascii_letters + string.digits
      return ''.join(random.choice(characters) for _ in range(8))