Home > other >  Python is a small white for help
Python is a small white for help

Time:10-25

Def fun (ls=[]) :
Ls. Append (1)
Return the ls
B=fun ()
Print (b)
A=fun ()
Print (b)
Print (a)


Why b will change??

CodePudding user response:

List is application of pointer!!!!!!

CodePudding user response:

Because it is not a copy,,,

CodePudding user response:

You even empty running a fun (), a and b will also change
  • Related