这是我写的描述我的问题的伪代码: -
func(s): #returns a value of s x = a list of strings print func(x) print x #these two should give the SAME output
当我最后打印x的值时,我希望它是func(x)返回的值.我只能通过编辑功能(并且不设置x = func(x))来执行此类操作
x = func(x)
python function mutable
function ×1
mutable ×1
python ×1