# 添加了一个string类型的元素添加到末尾
def ChangeList(lis):
lis.append('hello i am the addone')
print lis
return
lis = [1, 2, 3]
ChangeList(lis)
print lis [1,2,3, 'hello i am the addone'] [1,2, 3,'hello i am the addone']
def ChangeString(string): string = 'i changed as this' print string return string = 'hello world' ChangeString(string) print string
i changed as this hello world
以上就是Python引用传值概念的示例详解的详细内容,更多请关注Gxl网其它相关文章!
查看更多关于Python引用传值概念的示例详解的详细内容...
声明:本文来自网络,不代表【好得很程序员自学网】立场,转载请注明出处:http://www.haodehen.cn/did84388