On Sunday 21 January 2007 10:30, you wrote:
> johnf wrote:
> > Hi,
> > I want to find a item within a large tuple that contains tuples.
> > mytuple = (('name',123,'value'),('first',345,'newvalue'))
> > so a 'for loop' works
> > istrue = False
> > for i in range(len(mytuple)):
> > if 'first' in my
johnf wrote:
> Hi,
> I want to find a item within a large tuple that contains tuples.
> mytuple = (('name',123,'value'),('first',345,'newvalue'))
> so a 'for loop' works
> istrue = False
> for i in range(len(mytuple)):
> if 'first' in mytuple[i]:
This is better written as iteration over mytuple
Hi,
I want to find a item within a large tuple that contains tuples.
mytuple = (('name',123,'value'),('first',345,'newvalue'))
so a 'for loop' works
istrue = False
for i in range(len(mytuple)):
if 'first' in mytuple[i]:
istrue = True
break
if istrue:
print " true"
Is possible to us