我是 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
函数是否都改变了原始地图对象(值)?但是在文档链接上的给定函数定义中没有提到这样的事情。
提前致谢
相关分类