Open study

is now brainly

With Brainly you can:

  • Get homework help from millions of students and moderators
  • Learn how to solve problems with step-by-step explanations
  • Share your knowledge and earn points by helping other students
  • Learn anywhere, anytime with the Brainly app!

A community for students.

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)
See more answers at brainly.com
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.

Get this expert

answer on brainly

SEE EXPERT ANSWER

Get your free account and access expert answers to this and thousands of other questions

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.
Thanks very much. I see the point and I will post questions more clearly next time.

Not the answer you are looking for?

Search for more explanations.

Ask your own question

Other answers:

Not the answer you are looking for?

Search for more explanations.

Ask your own question