anonymous
  • anonymous
Hi, I have a query about problem 5 on Quiz 1. The solution says: v1 = v1[:] v2 = v2[:] at the beginning. Can anyone explain to me why we need to do this? Thanks
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.
schrodinger
  • schrodinger
I got my questions answered at brainly.com in under 10 minutes. Go to brainly.com now for free help!
anonymous
  • anonymous
post the complete problem/solution that would prevent the original list object from being mutated. are v1 and v2 function arguments? copy = original[:] is a way to copy a list, it creates a completely new list object and assigns it to the variable on the left side of the equal sign http://henry.precheur.org/python/copy_list http://python.net/~goodger/projects/pycon/2007/idiomatic/handout.html#other-languages-have-variables http://effbot.org/pyfaq/how-do-i-copy-an-object-in-python.htm it helps to reference the course you are taking - ppl taking OCW 6.00 (2008) and OCW 6.00c (2011) and sometimes the edX 6.00 post here - same basic course with similar problems and different pset numbers. please use a code pasting site to post code: - http://dpaste.com - http://pastebin.com - https://gist.github.com/ - http://pastie.org - http://codepad.org - http://ideone.com - http://www.repl.it/ paste your code there and post the link here. select Python syntax highlighting when u paste.
anonymous
  • anonymous
Thanks very much. I see the point and I will post questions more clearly next time.

Looking for something else?

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