PYTHON HELP, word not defined?
Question: so i keep getting the name 'word' is not defined on:

    
    
    #for every character in secret_word
        for char in word:
    

Context:

    
    
    import time
    name = input("What is your name? ")
    
    print ("Hello, " + name, "Time to play hangman!")     
    print ("\n")
    
    time.sleep(1)
    
    print ("Start guessing...")
    time.sleep(0.5)
    
    list = ["secret"]
    
    guesses = ' '
    
    turns = 10 
    
    while turns > 0:
    
        failed = 0
    
        #for every character in secret_word
        for char in words: 
           if char in guesses: 
                  print ("char,")
           else:
                  print ("_",)
           if failed == 0:
                print ("\nYou won")
    
               # exit the script 
           break 
    
           print
           guess = input("guess a character")
           guesses += guess
           if guess not in word:
                  turns -= 1
           print ("Wrong\n")
           print ("you have") , + turns, 'more guesses'
           if turns == 0:
                # print ("you lose\n")
                  print("exit")
    


Answer: You're referring to the variable "word" without defining it. Somewhere before
your for loop you have to define it like so:

    
    
    word = "myString"
    

You should post your actual code here instead of a screenshot next time.
Highlight it and hit control + k to mark it as code.

