Pregnancy test

I want to know if I'm  pregnant the Last time i has sex was 3 weeks ago. Can i do the test?