This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import random | |
HANGMAN = [ | |
'________', | |
'| |', | |
'| O', | |
'| |', | |
'| /|\ ', | |
'| |', |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def tokenize(program): | |
""" | |
Helper method to receive a program as string and return it as a list of | |
tokens | |
""" | |
# We add spaces in order to create tokens using whitespace as criteria | |
program_with_spaces = program.replace('(', ' ( ').replace(')', ' ) ') | |
return program_with_spaces.split() | |
def identify_element(element): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Esto es un ejemplo | |
def prueba(): | |
print("Hola") |