pregnancy

I got my periods on the 30th but I had sex on the 29th could u still get pregnant.. or would I have to be fertile?