Re: [Tutor] Add elements to list and display it [Very newbie question]

2009-03-02 Thread Kent Johnson
On Mon, Mar 2, 2009 at 5:36 PM, Network Administrator wrote: > I appreciate your explanation about the reserved word "list" as well as the > code you gently wrote to me. Now, I want to show everybody what I did: > > #!/usr/bin/env python > # > # This function fills any given li

Re: [Tutor] Add elements to list and display it [Very newbie question]

2009-03-02 Thread Network Administrator
Thanks, Eric for your help! I appreciate your explanation about the reserved word "list" as well as the code you gently wrote to me. Now, I want to show everybody what I did: #!/usr/bin/env python # # This function fills any given list # mylist = [] x = 0 while (x != 't2'):

Re: [Tutor] Add elements to list and display it [Very newbie question]

2009-02-27 Thread Eric Dorsey
Here is one possible implementation of your project. *Code:* #Dont use list as a variable name, its one of the reserved words. mylist = [] #realize any values captured here are strings x = raw_input('Enter num or text: ') mylist.append(x) x = raw_input('Enter num or text: ') mylist.append(x) #ou

Re: [Tutor] Add elements to list and display it [Very newbie question]

2009-02-27 Thread spir
Le Fri, 27 Feb 2009 11:19:50 -0600, Network Administrator s'exprima ainsi: > I am beggining to learn Python and I appreciate if you help me with this: > > "I want a piece of a program to request the user to input "elements" > (numbers, text, etc) and store them into a list. Then, I want to displ

[Tutor] Add elements to list and display it [Very newbie question]

2009-02-27 Thread Network Administrator
I am beggining to learn Python and I appreciate if you help me with this: "I want a piece of a program to request the user to input "elements" (numbers, text, etc) and store them into a list. Then, I want to display all the elements one-per-line." I started using this code: #!/usr/bin/env python