Re: [Tutor] Help on Python Looping Please

2011-02-24 Thread Dave Angel
On 02/24/2011 11:55 AM, Walter Prins wrote: On 24 February 2011 16:22, Dave Angel wrote: (Is there a reason you double-spaced all that code? It makes it very hard to read, and quite difficult to quote, since I had to delete every other line.) For what it's worth the code came out perfectl

Re: [Tutor] Help on Python Looping Please

2011-02-24 Thread Walter Prins
On 24 February 2011 16:22, Dave Angel wrote: > > (Is there a reason you double-spaced all that code? It makes it very hard > to read, and quite difficult to quote, since I had to delete every other > line.) > For what it's worth the code came out perfectly fine on my email reader (GMail). (No d

Re: [Tutor] Help on Python Looping Please

2011-02-24 Thread pyhx0r
Dear All, Thank you for your advise, it's helpful for me. NB: To DaveA, It was copy-paste from my notepad so the indentation went wrong :( +---+--+---+ | py | h | x0r | +---+--+---+ ■ 1 3 0 E2 C 9 ■ ___ Tutor maillist - Tutor@python.org To u

Re: [Tutor] Help on Python Looping Please

2011-02-24 Thread Dave Angel
On 01/-10/-28163 02:59 PM, pyhx0r wrote: Dear All, multiple = 1024 if a_kilobyte_is_1024_bytes else 1000 for suffix in SUFFIXES[multiple]: size /= multiple if size< multiple: return '{0:.1f} {1}'.format(size, suffix) I’ve shorted the code be:

Re: [Tutor] Help on Python Looping Please

2011-02-24 Thread Walter Prins
On 24 February 2011 14:52, pyhx0r wrote: > *Why do in my code, it loops to all values and not in Mark Pilgrim’s code? > * > > Because in Mark's code the loop is terminated by the return statement (contained in the utility function approximate_size().) In your code you've removed the entire funct