Re: Accelerating For Loop

2011-02-23 Thread Stefan Behnel
Şansal Birbaş, 23.02.2011 07:34: I needed to find the cheapest combination among given data and I developed an algorithm for this task. It works correctly. But it takes much time (nearly 2 minutes) for second function to find the result while it is just one second for the first function. How

Re: Accelerating For Loop

2011-02-23 Thread Peter Otten
Şansal Birbaş wrote: for i in range(1,5): for j in i*range(max_expander+1): for k in i*range(max_expander+1): for m in i*range(max_expander+1): for r in i*range(max_expander+1): I must be missing something, but I can't see why you

Accelerating For Loop

2011-02-22 Thread Şansal Birbaş
Hi All, I needed to find the cheapest combination among given data and I developed an algorithm for this task. It works correctly. But it takes much time (nearly 2 minutes) for second function to find the result while it is just one second for the first function. How can I improve the

Re: Accelerating For Loop

2011-02-22 Thread Chris Rebert
2011/2/22 Şansal Birbaş sansal.bir...@alarko-carrier.com.tr: Hi All, I needed to find the cheapest combination among given data and I developed an algorithm for this task. It works correctly. But it takes much time (nearly 2 minutes) for second function to find the result while it is just

RE: Accelerating For Loop

2011-02-22 Thread Şansal Birbaş
Nothing changed, Mr. Chris -Original Message- From: ch...@rebertia.com [mailto:ch...@rebertia.com] On Behalf Of Chris Rebert Sent: Wednesday, February 23, 2011 9:37 AM To: Şansal Birbaş Cc: python-list@python.org Subject: Re: Accelerating For Loop 2011/2/22 Şansal Birbaş sansal.bir