#函数的参数
for i in range(10):
print(i)
for i in range(1,10):
print(i)
for i in range(1,10,2):
print(i)
def my_test(a,b=0,c=0):
print(123,a,b,c)
my_test(1) #TypeError: my_test() missing 1 required positional argument: 'b'
my_test(1,2,3) #TypeError: my_test() takes 2 positional arguments but 3 were given
my_test(1,c=4,b=5)
#my_test(c=4,b=5,1) #关键字参数放在位置参数之后是错误的
SDUWH2019-2020寒假python实训--Chp7
最新推荐文章于 2022-09-24 14:50:54 发布