Firstly, it would be "i = turtle.getItemCount(SLOT)", replacing SLOT by the slot number you need to check (1 to 16).
Secondly, the "turtle.drop()" function drops everything in the selected slot by default, the number is only good to make it drop less than the max.