在寻找了很长时间并询问后:https : //gitter.im/timothycrosley/hug 我找不到解决方案。
我正在寻找的是一种返回自定义http代码的方法,可以说204,以防在get端点满足条件。路由问题的说明在这里
但我似乎无法找到一种方法来返回200以外的任何其他代码,且响应为空
新的python.现在无法找出这个问题的答案2天..会感激一些帮助,谷歌搜索没有帮助.
填写"foo"和"bar"函数,以便它们可以接收可变数量的参数(3或更多)"foo"函数必须返回所接收的额外参数的数量.如果带有关键字"magicnumber"的参数值为7,则"bar"必须返回"True",否则返回False.
# edit the functions prototype and implementation
def foo(a, b, c):
pass
def bar(a, b, c):
pass
# test code
if foo(1,2,3,4) == 1:
print "Good."
if foo(1,2,3,4,5) == 2:
print "Better."
if bar(1,2,3,magicnumber = 6) == False:
print "Great."
if bar(1,2,3,magicnumber = 7) == True:
print "Awesome!"
Run Code Online (Sandbox Code Playgroud)
我猜..一些部分代码会很好,无法理解**kwargs以及所有这些: