Cod*_*ein -1 python shell list output
我在Python中有一个非常简单的程序,但它不会打印出shell中的列表.
该计划是:
list1 = [20]
print "list1 = ", list
def change(alist):
alist.append(100)
change(list1)
print "list1 = ", list
Run Code Online (Sandbox Code Playgroud)
当我在shell中尝试它时,我得到了
>>> import test
list1 = <type 'list'>
list1 = <type 'list'>
Run Code Online (Sandbox Code Playgroud)
如何打印列表中的实际值?
| 归档时间: |
|
| 查看次数: |
66 次 |
| 最近记录: |