browse/
2 results
languages/ruby-strings-why-changing-b-also-changes-a.md
Ruby strings: why changing b also changes a
In Ruby, `b = a` does not copy a string: it puts a second label on the same object. So `b << "s"` changes `a` too, while `b += "s"` does…
languages/python-default-arguments-why-a-function-remembers-the-last-call.md
Python default arguments: why a function remembers the last call
Call a small Python function twice and the second call remembers the first. The cause is a default value like `basket=[]`, which Python…