社区所有版块导航
Python
python开源   Django   Python   DjangoApp   pycharm  
DATA
docker   Elasticsearch  
aigc
aigc   chatgpt  
WEB开发
linux   MongoDB   Redis   DATABASE   NGINX   其他Web框架   web工具   zookeeper   tornado   NoSql   Bootstrap   js   peewee   Git   bottle   IE   MQ   Jquery  
机器学习
机器学习算法  
Python88.com
反馈   公告   社区推广  
产品
短视频  
印度
印度  
Py学习  »  Python

列表的返回函数在python中不显示在屏幕上

Ishk • 5 年前 • 1364 次点击  

return函数工作得很好,但不知怎么的,return list没有显示在屏幕上。

def test(lst):
    ls = []
    lst[:] = [ele + 1 for ele in lst] # lst[:] changes the original list

    ls.append(lst)
    return ls

test([1,2,3])
Python社区是高质量的Python/Django开发社区
本文地址:http://www.python88.com/topic/43010
 
1364 次点击  
文章 [ 3 ]  |  最新文章 5 年前