Python Forum
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[split] print twice?????
#1
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
Reply
#2
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.
Reply
#3
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 :)
Reply
#4
Thank you everyone for your help, i got it.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  [split] Print JSON Dictionary to Excel? venukommu 1 2,287 Nov-15-2019, 09:33 PM
Last Post: micseydel
  [split] how to print unicode in python? Frank57 4 2,999 Oct-28-2019, 08:57 PM
Last Post: Frank57

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020