input: Write a function to generate a random password of 8 characters. The password should consist of letters and digits. If the input is not applicable, the function should return the generated password string.
  assert generate_password()==any 8 character string containing letters and digits
  assert generate_password()==any 8 character string containing letters and digits
  assert generate_password()==any 8 character string containing letters and digits
  assert generate_password()==any 8 character string containing letters and digits
output: import random
  import string
  
  def generate_password():
      return ''.join(random.choices(string.ascii_letters + string.digits, k=8))