transitions = { "The sky is": {"blue": 0.6, "gray": 0.3, "clear": 0.1}, "The sky is blue": {"today": 0.8, ".": 0.2} } text = "The sky is" for _ in range(2): choices = transitions[text] next_word = max(choices, key=choices.get) text += " " + next_word print(text)