Skip to content

Instantly share code, notes, and snippets.

@avivijay19
Last active June 27, 2022 07:05
Show Gist options
  • Save avivijay19/839c1a41a66d4ca2769aacf13dbbf7b0 to your computer and use it in GitHub Desktop.
Save avivijay19/839c1a41a66d4ca2769aacf13dbbf7b0 to your computer and use it in GitHub Desktop.
from dfa import *
from scan_input_file import *
dfa = scan_input_file("dfa.txt")
given_word = None
while given_word != '-1':
given_word = input('Type a word (-1 to exit): ')
if given_word == '-1':
print('\nExiting...')
else:
if dfa.check_word(given_word):
print('\tWord is valid\n')
else:
print('\tWord is NOT valid\n')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment