input: Write a function to generate a random password consisting of 8 characters. If the password contains only alphabetic letters or digits, then print the password. If the input is not applicable, return an empty string.
  
  assert generate_password()=="a1B2C3D4"
  assert generate_password()=="E5f6G7h8"
  assert generate_password()=="i9J0k1L2"
  assert generate_password()=="m3n4O5p6"
  assert generate_password()==""
output: import random
  import string
  
  def generate_password():
      password = ''.join(random.choices(string.ascii_letters + string.digits, k=8))
      if all(c.isalnum() for c in password):
          return password
      return ""