为什么它不返回任何东西?

时间:2017-09-30 19:05:28

标签: python-3.x

当我运行程序时,它不会返回值True或False。为什么会这样?

def esvocal(letter):
vocal = "a","e","i","o","u"
vocalup = "A","E","I","O","U" 

if letter == vocal and letter == vocalup:
    return True
else:
    return False 
esvocal("s")
esvocal("a")

1 个答案:

答案 0 :(得分:-2)

def esvocal(letter):
    vocal =[ "a","e","i","o","u"]
    vocalup = ["A","E","I","O","U"]

    if letter in vocal and letter in vocalup:
        return True
    else:
        return False 
esvocal("s")
esvocal("a")
  1. Python非常关心缩进
  2. 使用而不是==