mercredi 8 mai 2019

How to fix if statement in my def function

I write code.

if statement in function def.

i don't know why the answer always "yes"

a = input('''Yes or No

Type [Y/N]

''')

def test():

global a

if a == 'Y' or 'y':

    print("yes")

elif a == 'N' or 'n':

    print("no")

else:

    print("Not Yes and Not No")

test()

Aucun commentaire:

Enregistrer un commentaire