input: Write a function to generate a random string of a given length. The function should take an integer as input and return a string of lowercase alphabetic characters. If the input length is not provided or is invalid, the function should return an empty string.
  assert random_string(6)=='abcdef'
  assert random_string(0)==''
  assert random_string(1)=='a'
  assert random_string(-1)==''
  assert random_string('invalid')==''
output: import random
  import string
  
  def random_string(length=None):
      if not isinstance(length, int) or length <= 0:
          return ''
      return ''.join(random.choices(string.ascii_lowercase, k=length))