On 2015-5-15 21:07, Phoenix wrote:
What is wrong with this code?
'''
I am trying to see if I can create a list of tuples such that the first
coordinate of eachh tuple is itself a list of lists.
Then inside the loop I am trying to update a tuple such that I will add
a new list to its first coordinate and change its other coordinate.
'''
I think this is closer to what you want:
c = []
for (x,y) in b:
x.append( [4,5,6] )
c.append( (x,y+1) )
b = c
Or:
b = [ (x+[[4,5,6]],y+1) for (x,y) in b ]
--
*\\* Anton Sherwood *\\* www.bendwavy.org
--
You received this message because you are subscribed to the Google Groups
"sage-support" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/sage-support.
For more options, visit https://groups.google.com/d/optout.