Tom Tucker wrote:
Hello all. Any suggestions how I could easily iterate over a list and
print the output 3 across (when possible)? One method I was considering
was removing the recently printed item from the list, checking list
length,
etc. Based on the remaining length of the list I
On 4/15/2012 10:54 PM, bob gailer wrote:
On 4/14/2012 11:27 AM, Tom Tucker wrote:
Hello all. Any suggestions how I could easily iterate over a list
and print the output 3 across (when possible)? One method I was
considering was removing the recently printed item from the list,
checking
On 4/14/2012 11:27 AM, Tom Tucker wrote:
Hello all. Any suggestions how I could easily iterate over a list and
print the output 3 across (when possible)? One method I was
considering was removing the recently printed item from the list,
checking list length, etc. Based on the remaining
Hello all. Any suggestions how I could easily iterate over a list and
print the output 3 across (when possible)? One method I was considering
was removing the recently printed item from the list, checking list length,
etc. Based on the remaining length of the list I would then print X
across.
On 14/04/12 16:27, Tom Tucker wrote:
Hello all. Any suggestions how I could easily iterate over a list and
print the output 3 across (when possible)?
Using the step size argument to range:
L = range(12)
for n in range(0,len(L),3):
...print L[n],L[n+1],L[n+2]
...
0 1 2
3 4 5
6 7 8
9 10
On 14 April 2012 16:27, Tom Tucker tktuc...@gmail.com wrote:
Hello all. Any suggestions how I could easily iterate over a list and
print the output 3 across (when possible)? One method I was considering
was removing the recently printed item from the list, checking list length,
etc. Based
On 14 April 2012 18:29, Bod Soutar bod...@googlemail.com wrote:
On 14 April 2012 16:27, Tom Tucker tktuc...@gmail.com wrote:
Hello all. Any suggestions how I could easily iterate over a list and
print the output 3 across (when possible)? One method I was considering
was removing the
All,
Thanks for the help.
On Sat, Apr 14, 2012 at 1:33 PM, Bod Soutar bod...@googlemail.com wrote:
On 14 April 2012 18:29, Bod Soutar bod...@googlemail.com wrote:
On 14 April 2012 16:27, Tom Tucker tktuc...@gmail.com wrote:
Hello all. Any suggestions how I could easily iterate over a
On 04/14/2012 01:55 PM, Tom Tucker wrote:
All,
Thanks for the help.
Please try to post your messages AFTER the part you're quoting.
Another very useful feature is enumerate(). Instead of doing
for item in mylist:
count += 1
if count...
do something like:
for index, item in
Bod Soutar wrote:
How about something like this
mylist = ['serverA', 'serverB', 'serverC', 'serverD','serverE', 'serverF',
'serverG']
tempstr =
count = 0
for item in mylist:
count += 1
if count == 3:
tempstr += (i + \n)
count = 0
else:
tempstr += (i + )
10 matches
Mail list logo