![]() |
|
![]() |
|
|
Thread Tools | Display Modes |
|
|
|
|
#1 |
|
Newbie
Join Date: Nov 2007
Posts: 14
Rep Power: 0
![]() |
Question Number 2 - printTwice
I'm back with another simple question.
I won't dwell over this like I did the last one. I'd just like to know why the author of the book I've been reading says printTwice(5) Gives the result 5 5 He has a few different examples all to do with the printTwice call but when I try and do it, it says Traceback (most recent call last): File "<interactive input>", line 1, in <module> NameError: name 'printTwice' is not defined Thanks. |
|
|
|
|
|
#2 |
|
Hobbyist Programmer
|
Re: Question Number 2 - printTwice
Because, presumably, you haven't defined printTwice in that script / interactive session. My guess is you're reading a bit too fast and missed something like:
def printTwice(arg):
print arg
print arg |
|
|
|
|
|
#3 | |
|
Newbie
Join Date: Nov 2007
Posts: 14
Rep Power: 0
![]() |
Re: Question Number 2 - printTwice
Quote:
Thanks for that. Not sure how I missed it but I thought it was like "print" but just printed it twice instead of once. Thanks again. |
|
|
|
|
![]() |
| Bookmarks |
| Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Question Number 1 | blake_jl | Python | 11 | Nov 24th, 2007 8:47 PM |
| c-unix-childprocesses-random number | programmingnoob | C | 7 | Feb 6th, 2007 9:39 PM |
| very simple question. make button change number in edit box | nickm | Delphi | 2 | Apr 29th, 2006 11:47 PM |
| One more question infinite! | massive-war | C++ | 8 | Apr 11th, 2005 1:11 AM |
| Number Systems... | Ade | Coder's Corner Lounge | 7 | Jan 19th, 2005 6:32 AM |