input: Write a python function to generate a 4-digit code using random integers.
  assert len(generate_code()) == 4
  assert generate_code().isdigit()
  assert generate_code() != generate_code()
output: import random
  
  def generate_code():
      return ''.join(random.choices('0123456789', k=4))