The Escuela

← Automata in Python: all 2 parts

Computer science ยท Free practice

Automata in Python, Part 2: Running the DFA in Python

Watch the lesson by Dr. J. Ubaldo Quevedo, then practice as many times as you want: every New button gives you a new machine or string.

1. Watch

  • Start in machine["start_s"], then for each symbol x: s = machine["delta"][s + "," + x].
  • print(s) shows every state the machine visits.
  • At the end, return Accept if the last state is in machine["accept"], otherwise Reject.

2. Try it yourself

Practice as many times as you want. Every New button builds a new machine or string. It's free, and you don't need an account.

Correct so far: 0