Python Forum

Full Version: [split] print twice?????
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
it's supuse have to work but not for me, i am using python 3, any idea why???


>>> print_twice("spam")
Traceback (most recent call last):
File "<pyshell#11>", line 1, in <module>
    print_twice("spam")
NameError: name 'print_twice' is not defined
Split from https://python-forum.io/Thread-print-twice

Please don't reply to old threads like that, since you have a new problem you should create your own thread. (I've made it so that you have your own thread now.)

As for your question - the error seems self-evident. You haven't defined the function. You need to define the function before calling it.
What is print_twice supposed to do? Write a function to do that thing, and then print_twice will do that thing that it's supposed to do :)
Thank you everyone for your help, i got it.