The problem with this code is that if you input anything other than "bob" first, when you finally input "bob", the main function will print None instead. Please run this code to fully understand what i'm having trouble with and to provide me some answers.
def main(name):
print name
def x():
name = raw_input()
if name == "bob":
return name
else:
print "error"
x()
main(x())
x()in your code creates a recursion when"bob"is not entered. The function that pops off the call stack first your first incorrect input (not"bob"), in which casexreturns nothing, orNone. I would look into different ways of doing validation (use awhileloop instead of using recursion here), this looks confusing.