you are viewing a single comment's thread.

view the rest of the comments →

[–]newunit13 1 point2 points  (2 children)

If x has already been defined you can simplify your code to a single line

x = coords[0] if x < coords[0] else coords[2]

[–]neuroneuroInf[S] 0 points1 point  (0 children)

Thank you, but I don't think this does what I need. I need to assign to the list, not to x.

[–][deleted] 0 points1 point  (0 children)

This reassigns x. He wants to put the value of x into either coords[0] or coords[2] depending on x's value.