Python: How do I pass a string by reference?

前端 未结 7 1068
清歌不尽
清歌不尽 2020-12-05 18:21

From this link: How do I pass a variable by reference?, we know, Python will copy a string (an immutable type variable) when it is passed to a function as a parameter, but I

7条回答
  •  [愿得一人]
    2020-12-05 18:39

    Just pass it in as you would any other parameter. The contents won't get copied, only the reference will.

提交回复
热议问题