Understanding Variable Passing in Python and Java
About this video
Check out this video I made with revid.ai
Try the PDF to Brainrot
Create your own version in minutes
Video Transcript
Full text from the video
Python and Java don't pass variables the way you think they do. You think you're
handing a function your original variable, but it's not true call-by-reference. It’s called "call
by sharing." Imagine giving a friend a copy of your house address. They can go to your
house and mess with the furniture inside; that’s like modifying a list, and you'll see those
changes. But if your friend just tears up that copied address and writes down a new
one, it doesn't change your original address at all. That’s like reassigning
the variable inside the function. Your original variable is safe.
240,909+ Short Videos
Created By Over 14,258+ Creators
Whether you're sharing personal experiences, teaching moments, or entertainment - we help you tell stories that go viral.