You can turn the duckling onto its back / side and squeeze the vent with left hand first finger and thumb gently. If you don't see the penis pop out then it's a girl !

Once you have a few ducklings of each sex, you get to know what to look for.
I use the left hand to press gently, then the right to gently apply the last bit of pressure with care.
Ideally you do need to be shown or try very gently because you can bruise / damage the sphincter.