There are multiple problems here. You added the import
statement. The test() function needs to return something. If not, it will return None
. Also, cryp.test
is a function object, while cryp.test()
is a call to the function.
The error message that is not in the question tells about this.
Traceback (most recent call last):
File "cryptek.py", line 4, in <module>
print "To be sure your name is: " + cryp.test()
TypeError: cannot concatenate 'str' and 'NoneType' objects
cryp.py
def test():
test = raw_input("> ")
return test
cryptek.py
import cryp
print "What is your name?"
cryp.test
print "To be sure your name is: " + cryp.test()
C:>python cryptek.py
What is your name?
> asdf
To be sure your name is: asdf