def who_are_you(tall,ginger,wears lenses):
if tall and ginger and wears glasses:
return "student 1"
if tall and not ginger and not wears lenses:
return " student 2"
if ginger and wears lenses and not tall:
return "student 3"
if wears lenses and not tall and not ginger:
return "student 4"
if tall and wears lenses and not ginger:
return "student 5"
else:
return "bossman"
#This is just for you to see what happens when the function is called
print who_are_you(True, True, True)
问题是变量名
wears lenses
应该是
wears_lenses
或者别的什么。变量名中不能使用空格。你知道吗另外,变量名也有问题:
wears glasses
应该是wears_lenses
相关问题 更多 >
编程相关推荐