Oto pseudokod pisałem opisując mój problem: -Jak zmutować listę za pomocą funkcji w python?
func(s):
#returns a value of s
x = a list of strings
print func(x)
print x #these two should give the SAME output
Kiedy drukować wartość x w końcu, chcę to być jeden zwrócony przez func (x). Mogę zrobić coś takiego tylko poprzez edycję funkcji (i bez ustawiania x = func(x)
)
Umyć listę, a następnie ją zwrócić. –
Na przykład: "def func (s): s.append (" test "); return s' –