I wrote a program to play hangman---it\'s not finished but it gives me an error for some reason...
import turtle
n=False
y=True
list=()
print (\"welcome to the h
You assigned to a local name len
:
len=len(word)
Now len
is an integer and shadows the built-in function. You want to use a different name there instead:
length = len(word)
# other code
print "_ " * length
Other tips:
Use not
instead of testing for equality to False
:
while not n:
Ditto for testing for == True
; that is what while
already does:
while y: