Search Results

Showing results 1 to 4 of 4
Search took 0.01 seconds.
Search: Posts Made By: The Champ ; Forum: Python and child forums
Forum: Python Nov 17th, 2009
Replies: 2
Views: 259
Posted By The Champ
L = [ 0 , 2, 1 , -1 , -1 , -1, -1 ]

for i in L:
if i <= 0:
L.pop ( i )

print L

What I was expecting was that L = [ 0, 2, 1 ]
but the result was [ 2 , 1 , -1, -1 ]
Forum: Python Jun 20th, 2009
Replies: 5
Views: 241
Posted By The Champ
I think I know where I went wrong.
I was thinking in terms of C. So I thought that number can be directly entered in list as we do in array in C after declaring it. There is slightly different...
Forum: Python Jun 20th, 2009
Replies: 5
Views: 241
Posted By The Champ
Thanks. I really wanted to see how to enter numbers in the list without initialization it completely. The second solution in your thread solved the problem.

Thanks once again.
Forum: Python Jun 20th, 2009
Replies: 5
Views: 241
Posted By The Champ
Question:

Prompt user to enter ten two digit number. The program should compute the sum of all positive values and print the sum of values added.

Over here what I had done is:

Chosen list to...
Showing results 1 to 4 of 4

 


About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC