anonymous
  • anonymous
I have trying to figure out how best to compare two tuples and return the values that do not match (for PS3d). Any suggestions?
MIT 6.00 Intro Computer Science (OCW)
  • Stacey Warren - Expert brainly.com
Hey! We 've verified this expert answer for you, click below to unlock the details :)
SOLVED
At vero eos et accusamus et iusto odio dignissimos ducimus qui blanditiis praesentium voluptatum deleniti atque corrupti quos dolores et quas molestias excepturi sint occaecati cupiditate non provident, similique sunt in culpa qui officia deserunt mollitia animi, id est laborum et dolorum fuga. Et harum quidem rerum facilis est et expedita distinctio. Nam libero tempore, cum soluta nobis est eligendi optio cumque nihil impedit quo minus id quod maxime placeat facere possimus, omnis voluptas assumenda est, omnis dolor repellendus. Itaque earum rerum hic tenetur a sapiente delectus, ut aut reiciendis voluptatibus maiores alias consequatur aut perferendis doloribus asperiores repellat.
katieb
  • katieb
I got my questions answered at brainly.com in under 10 minutes. Go to brainly.com now for free help!
anonymous
  • anonymous
My suggestion is to work with lists and convert it to a tuple when you need it, or vice versa. This is for two reasons. First, lists are mutable and, therefore, if you need to change things around then you can do so with lists but not with tuples. Second, more operations and methods are supported for lists than tuples. If I am receiving a tuple as a parameter for a function, for example, then I will convert it to a list, do whatever processing I need to do, and then convert the list(s) to tuple I necessary. For example, def someFunction(tup) t=list(tup) #do whatever processing i need against the list x=tuple(t) return x
anonymous
  • anonymous
something like this?? http://dpaste.com/693397/
anonymous
  • anonymous
Surely not the most efficient way, but it appears to work - http://dpaste.com/693792/

Looking for something else?

Not the answer you are looking for? Search for more explanations.

More answers

anonymous
  • anonymous
Hello, there is also list comprehensions !!! http://docs.python.org/tutorial/datastructures.html#list-comprehensions So it will be just like http://dpaste.com/hold/694119/ Voila !!!
anonymous
  • anonymous
Well den2042, doesn't that just make it too easy :) thanks!

Looking for something else?

Not the answer you are looking for? Search for more explanations.