我當然知道這是不能直接在Python中,在 Statement decorators 讀,但我仍想找到一種方法,以編程方式打開(和關閉)的循環爲: for i in range(L[:]):
# do stuff
到 for i in range(L[0:N])):
# estimate how much time it
# took to run the loo
我很難找到適合此問題的標題,所以請原諒我。 在我班上的很多方法是這樣的: def one_of_many():
# code to determine `somethings`
for something in somethings:
if self.try_something(something):
return
# code to det