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: >

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)

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 below

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 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 his

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

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 much

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 --