Re: Python while loop

2016-11-30 Thread John Gordon
In <0c642381-4dd2-48c5-bb22-b38f2d5b2...@googlegroups.com> paul.garcia2...@gmail.com writes: > Write a program which prints the sum of numbers from 1 to 101 > (1 and 101 are included) that are divisible by 5 (Use while loop) > x=0 > count=0 > while x<=100: > if x%5==0: > count=count+

Re: Python while loop

2016-11-29 Thread BartC
On 29/11/2016 23:58, paul.garcia2...@gmail.com wrote: Write a program which prints the sum of numbers from 1 to 101 ( 1 and 101 are included) that are divisible by 5 (Use while loop) This is the code: x=0 count=0 while x<=100: if x%5==0: count=count+x x=x+1 print(count) This

Re: Python while loop

2016-11-29 Thread MRAB
On 2016-11-29 23:58, paul.garcia2...@gmail.com wrote: Write a program which prints the sum of numbers from 1 to 101 ( 1 and 101 are included) that are divisible by 5 (Use while loop) This is the code: x=0 count=0 while x<=100: if x%5==0: count=count+x x=x+1 print(count) Quest

Python while loop

2016-11-29 Thread paul . garcia2345
Write a program which prints the sum of numbers from 1 to 101 ( 1 and 101 are included) that are divisible by 5 (Use while loop) This is the code: x=0 count=0 while x<=100: if x%5==0: count=count+x x=x+1 print(count) Question: How does python know what count means ? I

Re: Python While loop Takes too much time.

2014-07-01 Thread Denis McMahon
On Tue, 01 Jul 2014 14:40:18 +0200, Peter Otten wrote: > What I'm trying to tell you: you need to put in some work to identify > the culprit... His next question was "how do I read a range from excel, please give me an example" I gave him an example of using google to search for solutions to hi

Re: Python While loop Takes too much time.

2014-07-01 Thread Peter Otten
Jaydeep Patil wrote: > Dear Peter, > I have tested code written by you. But still it is taking same time. Too bad ;( If you run the equivalent loop written in Basic from within Excel -- is that faster? If you run the loop in Python with some made-up data instead of that fetched from Excel --

Re: Python While loop Takes too much time.

2014-07-01 Thread Jaydeep Patil
On Monday, 30 June 2014 18:16:21 UTC+5:30, Peter Otten wrote: > Jaydeep Patil wrote: > > > > > I have did excel automation using python. > > > In my code I am creating python dictionaries for different three columns > > > data at a time.There are are many rows above 4000. Lets have look in be

Re: Python While loop Takes too much time.

2014-06-30 Thread Gregory Ewing
marco.naw...@colosso.nl wrote: In the past I even dumped an EXCEL sheet as a CSV file That's probably the only way you'll speed things up significantly. In my experience, accessing Excel via COM is abysmally slow no matter how you go about it. -- Greg -- https://mail.python.org/mailman/listinf

Re: Python While loop Takes too much time.

2014-06-30 Thread marco . nawijn
On Monday, June 30, 2014 1:32:23 PM UTC+2, Jaydeep Patil wrote: > I have did excel automation using python. > > In my code I am creating python dictionaries for different three columns data > at a time.There are are many rows above 4000. Lets have look in below > function. Why it is taking too m

Re: Python While loop Takes too much time.

2014-06-30 Thread Peter Otten
Jaydeep Patil wrote: > I have did excel automation using python. > In my code I am creating python dictionaries for different three columns > data at a time.There are are many rows above 4000. Lets have look in below > function. Why it is taking too much time? > > Code: > > def transientTestDict

Python While loop Takes too much time.

2014-06-30 Thread Jaydeep Patil
I have did excel automation using python. In my code I am creating python dictionaries for different three columns data at a time.There are are many rows above 4000. Lets have look in below function. Why it is taking too much time? Code: def transientTestDict(self,ws,startrow,startcol):

Re: Triple nested loop python (While loop insde of for loop inside of while loop)

2013-03-04 Thread Ulrich Eckhardt
Am 01.03.2013 17:28, schrieb Isaac Won: What I really want to get from this code is m1 as I told. For this purpose, for instance, values of fpsd upto second loop and that from third loop should be same, but they are not. Actually it is my main question. You are not helping yourself... In any

Re: Triple nested loop python (While loop insde of for loop inside of while loop)

2013-03-01 Thread Isaac Won
Thank you Ulich for reply, What I really want to get from this code is m1 as I told. For this purpose, for instance, values of fpsd upto second loop and that from third loop should be same, but they are not. Actually it is my main question. Thank you, Isaac On Friday, March 1, 2013 6:00:42 AM UTC

Re: Triple nested loop python (While loop insde of for loop inside of while loop)

2013-03-01 Thread Isaac Won
On Friday, March 1, 2013 7:41:05 AM UTC-6, Chris Angelico wrote: > On Fri, Mar 1, 2013 at 7:59 PM, Isaac Won wrote: > > > while c <24: > > > for columns in ( raw.strip().split() for raw in f ): > > > while d <335: > > > > Note your indentation levels: the code does not agree

Re: Triple nested loop python (While loop insde of for loop inside of while loop)

2013-03-01 Thread Isaac Won
Thank you, Chris. I just want to acculate value from y repeatedly. If y = 1,2,3...10, just have a [1,2,3...10] at onece. On Friday, March 1, 2013 7:41:05 AM UTC-6, Chris Angelico wrote: > On Fri, Mar 1, 2013 at 7:59 PM, Isaac Won wrote: > > > while c <24: > > > for columns in ( raw.strip

Re: Triple nested loop python (While loop insde of for loop inside of while loop)

2013-03-01 Thread Chris Angelico
On Fri, Mar 1, 2013 at 7:59 PM, Isaac Won wrote: > while c <24: > for columns in ( raw.strip().split() for raw in f ): > while d <335: Note your indentation levels: the code does not agree with your subject line. The third loop is not actually inside your second. Should it be? Ch

Re: Triple nested loop python (While loop insde of for loop inside of while loop)

2013-03-01 Thread Joel Goldstick
On Fri, Mar 1, 2013 at 7:00 AM, Ulrich Eckhardt < ulrich.eckha...@dominolaser.com> wrote: > Am 01.03.2013 09:59, schrieb Isaac Won: > > try to make my triple nested loop working. My code would be: >> c = 4 >> > [...] > > while c <24: >> c = c + 1 >> > > This is bad style and you shouldn

Re: Triple nested loop python (While loop insde of for loop inside of while loop)

2013-03-01 Thread Ulrich Eckhardt
Am 01.03.2013 09:59, schrieb Isaac Won: try to make my triple nested loop working. My code would be: c = 4 [...] while c <24: c = c + 1 This is bad style and you shouldn't do that in python. The question that comes up for me is whether something else is modifying "c" in that loop,

Triple nested loop python (While loop insde of for loop inside of while loop)

2013-03-01 Thread Isaac Won
try to make my triple nested loop working. My code would be: c = 4 y1 = [] m1 = [] std1 = [] while c <24: c = c + 1 a = [] f.seek(0,0) for columns in ( raw.strip().split() for raw in f ): a.append(columns[c])