只要我的列表中有大于3的值,我就想运行while循环。你知道吗
例如:
while 3 or greater not in list:
run loop
有没有什么技巧可以实现这一点,而不必创建另一个循环来检查这一点?你知道吗
谢谢
编辑:
谢谢你的建议。我实际上是在检查2D numpy阵列。我最后把它做成这样:
tilemap = np.zeros((mapheight, mapwidth), dtype = np.int)
while max(tilemap.ravel()) > 3:
run loop
Tags:
你可能在寻找这样的线索:
例如:
它离开了
相关问题 更多 >
编程相关推荐