Can you get your period but be pregnant?

my friend told me the other day that for example say if you think your pregnant, and are waiting to come on to see if you are or not and then you come on your period so because of that you think your not pregnant. Can you still be pregnant even though youve been on?