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,16 @@
# 要编写一个接受任意数量参数的函数,可以使用*
def avg(first, *rest):
return (first + sum(rest))/(len(rest) + 1)
# 如果是关键字类型的参数,那就需要使用**
def make_element(name, value, **attrs):
for item in attrs.items():
print("'{} = {}'".format(*item))
return 0
# *与**有使用上的限制,它们必须在所有参数的最后,**必须在*后面
def anyargs(*args, **kwargs):
print(args)
print(kwargs)