probability – Player input prediction pseudoCode

I am making a simple game where a player has to select either heads or tails.
So let heads be 0 and tails be 1. now suppose he chooses a sequence like this:
0,1,0,1,0,1… or
So is there any way i can find the pattern mathematically and guess the next prediction.
Eventhough i am coding in python, a pseudocode will be more than enough

If computer guesses right,it will get a point and the other way around