Python Forum
[split] print twice????? - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: Python Coding (https://python-forum.io/forum-7.html)
+--- Forum: General Coding Help (https://python-forum.io/forum-8.html)
+--- Thread: [split] print twice????? (/thread-11649.html)



[split] print twice????? - rafafiqui - Jul-19-2018

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



RE: [split] print twice????? - micseydel - Jul-19-2018

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.


RE: [split] print twice????? - nilamo - Jul-19-2018

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 :)


RE: [split] print twice????? - rafafiqui - Jul-19-2018

Thank you everyone for your help, i got it.