The python code predicts a sentence of certain length starting with a word entered by the user using the basic concepts of CDF and Probability.
We calculate the sample space of each word and find the cdf. Then using a random generated decimal between 0 and 1 we predict that what might be the next word.