input: Write a function to generate a random string of a specified length. If the specified length is not provided, the function should default to generating a string of 10 characters.
  assert generate_string(10)=='kR2jE9dL8m'
  assert generate_string()=='3YbT7c5mQx'
  assert generate_string(15)=='aB4cD7eFgH2iJ8'
  assert generate_string(5)=='9LmP2'
  assert generate_string(20)=='Xa5Qb6Rc7Sd8Te9Yf0U'
output: import random
  import string
  
  def generate_string(length=10):
      return ''.join(random.choices(string.ascii_letters + string.digits, k=length))