On 2008-05-06, hdante <[EMAIL PROTECTED]> wrote: > When you have a problem with your code, always post here the complete > code and a complete execution. For example:
I'll keep this example. Thnx. > /----------\ glued > | bruce | ------> 42 > \----------/ > > When you use a stamp, it returns what it's glued on: > > >>> bruce = 42 # glue a stamp > >>> print bruce # use the stamp > 42 > 'bruce' is a string (notice the quotes). In this case bruce is glued > to 'bruce': > > /----------\ glued > | bruce | ------> 'bruce' > \----------/ The light is dawning..... > Stupid. Not really. :-) I'd rather say that the problem is the book. Well, me too, of course. ;) > The book is just another introduction to programming. There's no > special attempt to make the reader learn to think like a computer > scientist. Apparently, and I understand. It's hard for someone who is very knowledgable on a subject to remain in "explain it like they're 5 yrs old" mode. It's tedious and time consuming. >> How am I supposed to get the original def to work? I've yet to figure out > file myfile.py: > ------------------------------- > def print_twice(bruce): > print bruce, bruce > > print_twice('bruce') > print_twice(2) > ------------------------------- > > execution: > ------------------------------- > $ python myfile.py > bruce bruce > 2 2 BINGO! (and it worked (after I got the indents right)) > Finally, you don't understand something, ask again. Thank you. I really do appreciate your taking the time to break it down so completely. I found another python book (A Byte of Python) that keeps it simple enough for me. I'm not really a programmer, but I decided to do something to challenge this old geezer brain and figured this would keep it awake. I'd also like to thank all you other folks who responded. I got some good info and tips from all of you. nb -- http://mail.python.org/mailman/listinfo/python-list