This is a part of my program. It gives the error NameError: name 'urlss' is not defined
NameError: name 'urlss' is not defined
def testfunc(): urlss = "hey" return urlss print urlss
Why does this occur?
urlss is a variable local to the scope of testfunc(); it cannot be accessed elsewhere. You might mean
urlss
testfunc()
print testfunc()
which in this case prints urlss, since that's what testfunc() returns.
2.1m questions
2.1m answers
60 comments
57.0k users