list-copy function using None : None « Data Type « Python Tutorial






def f(a, mylist=None):
    if mylist is None:
        mylist = []
    mylist.append(a)
    return mylist








2.13.None
2.13.1.list-copy function using None
2.13.2.building a list from another list