input: Write a function to generate a random string of length 6 based on the given input. Use the `random` and `string` modules to achieve this.
  import random
  import string
  
  def random_string(length):
      letters = string.ascii_lowercase
      return ''.join(random.choice(letters) for i in range(length))
  
  # Test cases
  assert len(random_string(6)) == 6
  assert all(c in string.ascii_lowercase for c in random_string(6))
  assert random_string(6) != random_string(6)
output: def random_string(length):
      letters = string.ascii_lowercase
      return ''.join(random.choice(letters) for i in range(length))