python中将实参变为可选项
2021-06-08 21:04
标签:iss file aaa 报错 style fir last red cal 1、 python中将实参变为可选项 标签:iss file aaa 报错 style fir last red cal 原文地址:https://www.cnblogs.com/liujiaxin2018/p/14510515.html>>> def a(first,meddle,last):
b = f"{first} {meddle} {last}"
return b.title()
>>> a("aaa","bbb","ccc")
‘Aaa Bbb Ccc‘
>>> a("aaa","bbb") ## 少一个实参报错
Traceback (most recent call last):
File "
>>> def a(first,meddle,last):
b = f"{first} {meddle} {last}"
return b.title()
>>> a("aaa","bbb","ccc")
‘Aaa Bbb Ccc‘
>>> a("aaa","ccc") ## 少一个实参,报错
Traceback (most recent call last):
File "