猿问

python“所有”函数使列表为空

我是 python 的新手,正在学习它的内置函数,但是函数all() 没有按预期运行我不知道为什么。这是我的代码


n=map(int,input().strip().split())

print(all([j>0 for j in n]))

print(list(n)) #this line returning empty list

这是我的输入:


1 2 3 4 5 -9

我的输出:


False

函数是否都改变了原始地图对象(值)?但是在文档链接上的给定函数定义中没有提到这样的事情。


提前致谢


泛舟湖上清波郎朗
浏览 124回答 1
1回答
随时随地看视频慕课网APP

相关分类

Python
我要回答