python: how to change the value of function's input parameter?

This is handled in python by returning.

def appendFlag(target, value):
   target += value
   target += " "
   return target

you can use it like this:

m = appendFlag(m,"ok")

you can even return several variables like this:

def f(a,b):
   a += 1
   b += 1
   return a,b

and use it like this:

a,b = f(4,5)

You need to use an object that can be modified

>>> m = []
>>> def appendFlag(target, value):
...     target.append(value)
...     target.append(" ")
...
>>> appendFlag(m, "ok")
>>> m
['ok', ' ']