input: Write a function to create a random string of a specified length. The function should take an integer as input and return a string composed of random characters from a predefined set, including lowercase letters, uppercase letters, and digits. If the input length is 0, the function should return an empty string.
  assert generate_string(10)=='a1B2c3D4e5'
  assert generate_string(5)=='6FgH7'
  assert generate_string(0)==''
  assert generate_string(15)=='K8L9m0N1o2P3q4R'
output: import random
  import string
  
  def generate_string(length):
      if length == 0:
          return ''
      return ''.join(random.choices(string.ascii_letters + string.digits, k=length))