Python Variable Assignments

Python has rules about what 'is' valid syntax. How does your computer know what these are? Below, we look at a FSM which accpets vairables assigned to Boolean, String, and Number values (including expressions). The top layer is abstracted to be easily understood but, as you zoom in, you will find more accurate letter-level string acceptance criteria. The markov chain looks at the transitions between letters over a mass of variable assignments in the dataset, so we can analyse what patterns are more likely to occur in writing assignments!

Finite State Machine
Markov Chain

Challenges

1 / 11

Type a simple variable assignment, like x = 1 or name='hi'. Is it accepted by the FSM? What does the Markov chain predict will come next?

prediction will appear here
FSM: -
Markov: -