1. [] or [1,2,3]
for i in [] or [1,2,3]:
print(i)
将会输出1,2,3
2.[1,2,3] or []
for i in [1,2,3] or []
print(i)
将会输出1,2,3
3.[1,2,3] and []
for i in [1,2,3] and []:
print(i)
将会输出空值
4.[4,5,6] or [1,2,3]
for i in [4,5,6] or [1,2,3]:
print(i)
将会输出4,5,6
5.[4,5,6] and [1,2,3]
for i in [4,5,6] and [1,2,3]:
print(i)
将会输出1,2,3
最后
以上就是生动大雁最近收集整理的关于for I in [] or [1,2,3] 这种用法你肯定没见过吧的全部内容,更多相关for内容请搜索靠谱客的其他文章。
本图文内容来源于网友提供,作为学习参考使用,或来自网络收集整理,版权属于原作者所有。
发表评论 取消回复