I wrote a DFA (Deterministice Finite Automata) in python. It uses a graph like structure to build and traverse the DFA to validate languages based on the DFA created in main.
In the current main I have created a language that accepts
{an, bm | n,m > 0; where it starts and ends with b}
Below is an image representation of what this looks like.
Feel free to download and mess with the code.