[Tutor] Recursive function
vanam
raghavendra.gv.vanam at gmail.com
Thu Jul 17 15:13:49 CEST 2008
hi all,
i am new to programming, i just started writing scripts in python about
functions.There is a program by name hangman where in i take input three
characters and then concatenate the resultant output is compared to a three
letter string, if it is similar it will display the word as correct if not i
want to execute the same function which evokes to prompt for three
characters as input. The problem is i am not getting a runtime error.
below is the piece of code:
#word Hangman
print "Welcome to the Hangman"
print
print
a = raw_input("enter 1st letter=")
b = raw_input("enter 2nd letter=")
c = raw_input("enter 3rd letter=")
def cmp():
d = (a+b+c);
if (d=='PAN'):
print "word" 'd' "is correct"
else:
print "Try Again"
CALL();
def CALL():
cmp();
cmp()
--
Raghavendra Vanam
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20080717/fa6c616e/attachment.htm>
More information about the Tutor
mailing list