2025-09-10:仓库迁移

This commit is contained in:
2025-09-10 16:12:45 +08:00
parent e0e49b0ac9
commit 3130e336a1
146 changed files with 4066 additions and 0 deletions

View File

@@ -0,0 +1,24 @@
from scipy.stats import trim1
if __name__ == "__main__":
items = [1, 2, 3]
items = iter(items)
# 如果需要访问可迭代对象中的元素可以使用next函数
while True:
item = next(items, None)
if item is not None:
print(item)
else:
break
# next函数的第一个参数是一个可迭代对象第二个参数是None是没有元素的时候的返回值
# 如果不限制迭代器在没有元素后的返回值迭代器在迭代结束后会抛出一个StopIteration的错误
while True:
try:
item = next(items)
except StopIteration:
print("没东西了")
break