好得很程序员自学网

<tfoot draggable='sEl'></tfoot>

图解Python变量与赋值

这篇文章主要介绍了图解Python变量与赋值,现在分享给大家,也给大家做个参考。一起过来看看吧

>>> 10-a
Traceback (most recent call last):
 File "<stdin>", line 1, in <module>
NameError: name 'a' is not defined 
>>> def fun_a(a):
...   a = a+4
...
>>> g = 0
>>> fun_a(g)
>>> g
0 
>>> def fun_b(names):
...   names[0] = ['x', 'y']
...
>>> n_list = ['a','b','c']
>>> fun_b(n_list)
>>>
>>> n_list
[['x','y'], 'b', 'c'] 

以上就是图解Python变量与赋值的详细内容,更多请关注Gxl网其它相关文章!

查看更多关于图解Python变量与赋值的详细内容...

  阅读:41次