这个if/else条件代码有什么问题?

2024-04-24 07:12:52 发布

您现在位置:Python中文网/ 问答频道 /正文

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)

Tags: andyoutruereturnifisdefnot