Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我是 Python 和一般编程的新手。我有一个列表,我想要一个变量在循环中逐步获取列表的每个值。我应该使用哪个指令来推断列表的单个值?
b = [-100, -50, -150, -100, -100, -100, -50]
b = [-100, -50, -150, -100, -100, -100, -50] for x in b: print(x)
这将打印:
-100 -50 -150 -100 -100 -100 -50