On Saturday, 1 October 2016 14:17:06 UTC+10, Rustom Mody wrote:
> On Saturday, October 1, 2016 at 9:08:09 AM UTC+5:30, Sayth Renshaw wrote:
> > I do like [(f + ['0'] if len(f) < 5 else f) for f in fups ] Rustom, if
> > there are better non list comprehension options I would like to know as
> > g
On Saturday, 1 October 2016 14:17:06 UTC+10, Rustom Mody wrote:
> On Saturday, October 1, 2016 at 9:08:09 AM UTC+5:30, Sayth Renshaw wrote:
> > I do like [(f + ['0'] if len(f) < 5 else f) for f in fups ] Rustom, if
> > there are better non list comprehension options I would like to know as
> > g
On Saturday, October 1, 2016 at 9:08:09 AM UTC+5:30, Sayth Renshaw wrote:
> I do like [(f + ['0'] if len(f) < 5 else f) for f in fups ] Rustom, if there
> are better non list comprehension options I would like to know as generally I
> find then confusing.
Two points here — best taken independent
> > I want to go threw and for each index error at [4] append a 0.
>
> You want to append 0 if the list does not have at least 5 items?
>
> > p = re.compile('\d+')
> > fups = p.findall(nomattr['firstup'])
> > [x[4] for x in fups if IndexError fups.append(0)]
> > print(fups)
>
> > Unsure why I c
On Saturday, October 1, 2016 at 7:48:19 AM UTC+5:30, John Gordon wrote:
> In Sayth Renshaw writes:
>
> > I want to go threw and for each index error at [4] append a 0.
>
> You want to append 0 if the list does not have at least 5 items?
>
> > p = re.compile('\d+')
> > fups = p.findall(nomattr['
In <534d5506-1810-4a79-ac8f-95a664d17...@googlegroups.com> Sayth Renshaw
writes:
> I want to go threw and for each index error at [4] append a 0.
You want to append 0 if the list does not have at least 5 items?
> p = re.compile('\d+')
> fups = p.findall(nomattr['firstup'])
> [x[4] for x in fup
I have a list of lists of numbers like this excerpt.
['0', '0', '0', '0']
['0', '0', '0', '0']
['0', '0', '0', '0']
['0', '0', '0', '0']
['0', '0', '0', '0']
['0', '0', '0', '0']
['7', '2', '1', '0', '142647', '00']
['7', '2', '0', '1', '87080', '00']
['6', '1', '1', '1', '51700', '00']
['4', '1',