Re: [Tutor] functions in Python

2006-04-17 Thread Paul D. Eden
This only happens because the python interactive command-line (what you get when you just type 'python' in a terminal window) prints return values automatically for you. If you were executing f(4) in a program/script, the return value would be lost. Paul Payal Rathod wrote: > On Mon, Apr 17,

Re: [Tutor] Changing lists in place

2006-04-17 Thread Paul D. Eden
Lists are mutable, you are right. But the code you gave does not change the list. It changes the variable element which is separate from the list myList. If you want to change the list try something like this: mylist = [ 'One', ' two', ' three ' ] print mylist newlist = [] for elemen

Re: [Tutor] Changing lists in place

2006-04-17 Thread Paul D. Eden
Very true. Paul Kent Johnson wrote: > Paul D. Eden wrote: > >>Lists are mutable, you are right. >> >>But the code you gave does not change the list. It changes the variable >>element which is separate from the list myList. >> >>If you want

Re: [Tutor] wanted exercises in python

2006-04-18 Thread Paul D. Eden
If you have some programming experience already in another language you may want to try the examples in http://www.diveintopython.org/toc/index.html Paul Payal Rathod wrote: > Hi, > As I mentioned I have been reading Python a lot in last 2 months but > lack of examples and coding is not gettin