Python Hangman not working
Question: So, I've finished my Hangman project for a coding class and it's stuck in a
loop where it just keeps asking if you want to play, after that it defines the
word to play but it also TELLS you which word to play you're going to play. I
think the chained whiles and ifs have some wrong variables.

So, I beg for your help.

    
    
    __author__ = 'Rodrigo Cano'
    #Modulos
    
    import random
    import re
    
    #Variables Globales
    
    intentos = 0
    incorrectos = 0
    palabras = [(1,"disclosure"),(1,"thenational"),(1,"foals"),(1,"skepta"),(1,"shamir"),(1,"kanye"),
                  (1,"fidlar"),(1,"lcdsoundsystem"),(1,"lorde"),(1,"fkatwigs"),(1,"miguel"),(1,"rtj"),
                  (1,"boniver"),(1,"strokes"),(2,"vaporwave"),(2,"witchouse"),(2,"shoegaze"),(2,"memerap"),
                  (2,"paulblartisoursaviour"),(3,"glockenspiel"),(3,"aesthetic"),(3,"schadenfreude"),
                  (3,"bonvivant"),(3,"swag"),(3,"jue")]
    Ascii_Art =[""]
    Dibujo = ' '
    palabra_a_jugar = ''
    Array_Palabra = []
    Nuevas_Letras = ''
    letras = []
    Vidas = 0
    i = len(Array_Palabra)
    
    
    #Funciones
    
    def Definir_Palabra():
        eleccion = int(input("Bienvenido, que categoria quiere usar:"
                         '\n'"1 - Musica que Escuche Mientras Lo Hacia"
                         '\n'"2 - Generos Musicales"
                         '\n'"3 - Palabras Pretenciosas"))
        palabras_escogidas = [i for i in palabras if eleccion in i ]
        palabra_a_jugar = str(palabras_escogidas[random.randint(0,len(palabras_escogidas))].__getitem__(1))
        Array_Palabra = len(palabra_a_jugar) * ['*']
        return palabra_a_jugar, Array_Palabra
    
    def Letras_En_Palabra(letra):
        letras = [i for i, x in enumerate(palabra_a_jugar) if x == letra]
        for i in range (0, len(letras)):
            Array_Palabra[letras] = letra
        return letras,Array_Palabra
    
    def Letras_Jugadas(letra):
        for i in range(0,len(Nuevas_Letras)):
            Nuevas_Letras = re.findall(letra,Nuevas_Letras[i])
            if Nuevas_Letras != []:
                return 1
        return Nuevas_Letras
    def Eleccion():
        Choice = input("Quiere Jugar?")
        if Choice == 'si':
            Choice = 1
        elif Choice == 'no':
            Choice = 0
        return Choice
    
    # Juego
    Choice = Eleccion()
    def Juego(Choice):
        i = len(Array_Palabra)
        while Choice == 1:
            print(Definir_Palabra())
            while i != 0 :
                tiro = str.lower(input("adivine una letra"))
                if Letras_Jugadas(tiro) != 1:
                    Nuevas_Letras = Nuevas_Letras + tiro
                    letras = Letras_En_Palabra(tiro)
                    if Letras_Jugadas(tiro) != []:
                        i = len(letras) - 1
                        print("Letras Utilizadas",Nuevas_Letras)
                        print(Letras_En_Palabra(tiro))
                    else:
                        Vidas = Vidas + 1
                        Dibujo += Ascii_Art[Vidas]
                        print("WROOOONG")
                        print(Dibujo)
                        print("Letras Utilizadas",Nuevas_Letras)
                    if Vidas ==9:
                        i = 0
                else:
                    print("Letra ya Juagada",Nuevas_Letras)
            Eleccion()
    
    Juego(Choice)
    


Answer: The last line in your `Juego` should be `Choice = Eleccion()`, otherwise,
you're not actually changing the value of `Choice`, so the loop continues
indefinitely.

    
    
    def Juego(Choice):
        i = len(Array_Palabra)
        while Choice == 1:
            print(Definir_Palabra())
            while i != 0 :
                tiro = str.lower(input("adivine una letra"))
                if Letras_Jugadas(tiro) != 1:
                    Nuevas_Letras = Nuevas_Letras + tiro
                    letras = Letras_En_Palabra(tiro)
                    if Letras_Jugadas(tiro) != []:
                        i = len(letras) - 1
                        print("Letras Utilizadas",Nuevas_Letras)
                        print(Letras_En_Palabra(tiro))
                    else:
                        Vidas = Vidas + 1
                        Dibujo += Ascii_Art[Vidas]
                        print("WROOOONG")
                        print(Dibujo)
                        print("Letras Utilizadas",Nuevas_Letras)
                    if Vidas ==9:
                        i = 0
                else:
                    print("Letra ya Juagada",Nuevas_Letras)
            """
            >>>> CHANGED <<<<
            """
            Choice = Eleccion()   
    

Otherwise, the way you had it simply calls the function `Eleccion` but
_doesn't_ return the value to the `Choice` variable in scope of `Juego`
function.

