12
A minor headache for a beginner coder
(lemmy.dbzer0.com)
Welcome to the Python community on the programming.dev Lemmy instance!
Past
November 2023
October 2023
July 2023
August 2023
September 2023
Hum... No it won't.
It's something you only really learn from C or Rust, but your operations will set both to the same list. If you go and change the list, you will change both, but if you set one to a different list, you won't change the other list.
In other words, if you do
list1.push(4)
, you will changelist2
. Butlist1 = [3, 2, 1]
won't.