在python函数中,
可以使用如下方式声明并初始化参数
def to_smash(total_candies, n_friends=3):
"""Return the number of leftover candies that must be smashed after distributing
the given number of candies evenly between 3 friends.
>>> to_smash(91)
1
"""
return total_candies%n_friends
在此函数中,默认参数是3